summaryrefslogtreecommitdiffstats
ModeNameSize
-rw-r--r--.hgtags2634logstatsplain
d---------Demo702logstatsplain
d---------Doc860logstatsplain
d---------Grammar35logstatsplain
-rw-r--r--INTBENCH941logstatsplain
d---------Include3168logstatsplain
-rw-r--r--LICENSE13795logstatsplain
d---------Lib8175logstatsplain
d---------Mac472logstatsplain
-rw-r--r--Makefile.pre.in35991logstatsplain
d---------Misc1120logstatsplain
d---------Modules4050logstatsplain
d---------Objects1574logstatsplain
d---------PC1312logstatsplain
d---------PCbuild1530logstatsplain
d---------PCbuild81157logstatsplain
d---------Parser911logstatsplain
d---------Python2653logstatsplain
-rw-r--r--README4691logstatsplain
-rw-r--r--RELNOTES1208logstatsplain
d---------Tools569logstatsplain
-rwxr-xr-xconfigure639441logstatsplain
-rw-r--r--configure.in97834logstatsplain
-rwxr-xr-xinstall-sh7122logstatsplain
-rw-r--r--pyconfig.h.in27887logstatsplain
-rwxr-xr-xruntests.sh2144logstatsplain
-rw-r--r--setup.py69145logstatsplain
./demos/photoviewer/qml/photoviewer.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ examples/declarative/demos/rssnews/main.cpp | 14 + .../demos/rssnews/qml/content/BusyIndicator.qml | 53 ++ .../demos/rssnews/qml/content/CategoryDelegate.qml | 82 ++ .../demos/rssnews/qml/content/NewsDelegate.qml | 71 ++ .../demos/rssnews/qml/content/RssFeeds.qml | 59 ++ .../demos/rssnews/qml/content/ScrollBar.qml | 107 +++ .../demos/rssnews/qml/content/images/busy.png | Bin 0 -> 2629 bytes .../demos/rssnews/qml/content/images/scrollbar.png | Bin 0 -> 161 bytes examples/declarative/demos/rssnews/qml/rssnews.qml | 111 +++ .../demos/rssnews/qml/rssnews.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ examples/declarative/demos/rssnews/rssnews.desktop | 11 + examples/declarative/demos/rssnews/rssnews.png | Bin 0 -> 3400 bytes examples/declarative/demos/rssnews/rssnews.pro | 39 + examples/declarative/demos/rssnews/rssnews.svg | 93 +++ examples/declarative/demos/samegame/main.cpp | 14 + .../demos/samegame/qml/SamegameCore/BoomBlock.qml | 109 +++ .../demos/samegame/qml/SamegameCore/Button.qml | 75 ++ .../demos/samegame/qml/SamegameCore/Dialog.qml | 77 ++ .../samegame/qml/SamegameCore/pics/background.png | Bin 0 -> 313930 bytes .../samegame/qml/SamegameCore/pics/blueStar.png | Bin 0 -> 278 bytes .../samegame/qml/SamegameCore/pics/blueStone.png | Bin 0 -> 3054 bytes .../samegame/qml/SamegameCore/pics/greenStar.png | Bin 0 -> 273 bytes .../samegame/qml/SamegameCore/pics/greenStone.png | Bin 0 -> 2932 bytes .../samegame/qml/SamegameCore/pics/redStar.png | Bin 0 -> 274 bytes .../samegame/qml/SamegameCore/pics/redStone.png | Bin 0 -> 2902 bytes .../demos/samegame/qml/SamegameCore/pics/star.png | Bin 0 -> 262 bytes .../samegame/qml/SamegameCore/pics/yellowStone.png | Bin 0 -> 3056 bytes .../demos/samegame/qml/SamegameCore/qmldir | 3 + .../demos/samegame/qml/SamegameCore/samegame.js | 238 ++++++ .../demos/samegame/qml/highscores/README | 1 + .../demos/samegame/qml/highscores/score_data.xml | 2 + .../demos/samegame/qml/highscores/score_style.xsl | 28 + .../demos/samegame/qml/highscores/scores.php | 34 + .../declarative/demos/samegame/qml/samegame.qml | 161 ++++ .../demos/samegame/qml/samegame.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../declarative/demos/samegame/samegame.desktop | 11 + examples/declarative/demos/samegame/samegame.png | Bin 0 -> 3400 bytes examples/declarative/demos/samegame/samegame.pro | 39 + examples/declarative/demos/samegame/samegame.svg | 93 +++ examples/declarative/demos/twitter/main.cpp | 14 + .../demos/twitter/qml/TwitterCore/Button.qml | 90 +++ .../demos/twitter/qml/TwitterCore/FatDelegate.qml | 105 +++ .../demos/twitter/qml/TwitterCore/Input.qml | 65 ++ .../demos/twitter/qml/TwitterCore/Loading.qml | 49 ++ .../twitter/qml/TwitterCore/MultiTitleBar.qml | 60 ++ .../demos/twitter/qml/TwitterCore/RssModel.qml | 76 ++ .../demos/twitter/qml/TwitterCore/SearchView.qml | 124 +++ .../demos/twitter/qml/TwitterCore/TitleBar.qml | 130 +++ .../demos/twitter/qml/TwitterCore/ToolBar.qml | 64 ++ .../demos/twitter/qml/TwitterCore/UserModel.qml | 65 ++ .../demos/twitter/qml/TwitterCore/images/gloss.png | Bin 0 -> 1236 bytes .../twitter/qml/TwitterCore/images/lineedit.png | Bin 0 -> 1415 bytes .../twitter/qml/TwitterCore/images/lineedit.sci | 5 + .../twitter/qml/TwitterCore/images/loading.png | Bin 0 -> 813 bytes .../demos/twitter/qml/TwitterCore/images/quit.png | Bin 0 -> 2369 bytes .../twitter/qml/TwitterCore/images/stripes.png | Bin 0 -> 257 bytes .../twitter/qml/TwitterCore/images/titlebar.png | Bin 0 -> 1436 bytes .../twitter/qml/TwitterCore/images/titlebar.sci | 5 + .../twitter/qml/TwitterCore/images/toolbutton.png | Bin 0 -> 2550 bytes .../twitter/qml/TwitterCore/images/toolbutton.sci | 5 + .../demos/twitter/qml/TwitterCore/qmldir | 10 + examples/declarative/demos/twitter/qml/twitter.qml | 134 ++++ .../demos/twitter/qml/twitter.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ examples/declarative/demos/twitter/twitter.desktop | 11 + examples/declarative/demos/twitter/twitter.png | Bin 0 -> 3400 bytes examples/declarative/demos/twitter/twitter.pro | 39 + examples/declarative/demos/twitter/twitter.svg | 93 +++ examples/declarative/demos/webbrowser/main.cpp | 14 + .../demos/webbrowser/qml/content/Button.qml | 65 ++ .../webbrowser/qml/content/FlickableWebView.qml | 195 +++++ .../demos/webbrowser/qml/content/Header.qml | 150 ++++ .../demos/webbrowser/qml/content/ScrollBar.qml | 107 +++ .../demos/webbrowser/qml/content/UrlInput.qml | 96 +++ .../demos/webbrowser/qml/content/pics/display.png | Bin 0 -> 998 bytes .../webbrowser/qml/content/pics/edit-delete.png | Bin 0 -> 831 bytes .../qml/content/pics/go-jump-locationbar.png | Bin 0 -> 408 bytes .../webbrowser/qml/content/pics/go-next-view.png | Bin 0 -> 1310 bytes .../qml/content/pics/go-previous-view.png | Bin 0 -> 1080 bytes .../webbrowser/qml/content/pics/scrollbar.png | Bin 0 -> 161 bytes .../webbrowser/qml/content/pics/titlebar-bg.png | Bin 0 -> 213 bytes .../webbrowser/qml/content/pics/view-refresh.png | Bin 0 -> 2182 bytes .../demos/webbrowser/qml/webbrowser.qml | 79 ++ .../demos/webbrowser/qml/webbrowser.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../demos/webbrowser/webbrowser.desktop | 11 + .../declarative/demos/webbrowser/webbrowser.png | Bin 0 -> 3400 bytes .../declarative/demos/webbrowser/webbrowser.pro | 39 + .../declarative/demos/webbrowser/webbrowser.svg | 93 +++ examples/declarative/examples.qmlproject | 16 - examples/declarative/i18n/i18n.desktop | 11 + examples/declarative/i18n/i18n.png | Bin 0 -> 3400 bytes examples/declarative/i18n/i18n.pro | 39 + examples/declarative/i18n/i18n.qmlproject | 16 - examples/declarative/i18n/i18n.svg | 93 +++ examples/declarative/i18n/i18n/base.ts | 12 - examples/declarative/i18n/i18n/qml_en_AU.qm | Bin 81 -> 0 bytes examples/declarative/i18n/i18n/qml_en_AU.ts | 12 - examples/declarative/i18n/i18n/qml_fr.qm | Bin 85 -> 0 bytes examples/declarative/i18n/i18n/qml_fr.ts | 12 - examples/declarative/i18n/main.cpp | 14 + examples/declarative/i18n/qml/i18n.qml | 78 ++ examples/declarative/i18n/qml/i18n.qmlproject | 16 + examples/declarative/i18n/qml/i18n/base.ts | 12 + examples/declarative/i18n/qml/i18n/qml_en_AU.qm | Bin 0 -> 81 bytes examples/declarative/i18n/qml/i18n/qml_en_AU.ts | 12 + examples/declarative/i18n/qml/i18n/qml_fr.qm | Bin 0 -> 85 bytes examples/declarative/i18n/qml/i18n/qml_fr.ts | 12 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../imageelements/borderimage/borderimage.desktop | 11 + .../imageelements/borderimage/borderimage.png | Bin 0 -> 3400 bytes .../imageelements/borderimage/borderimage.pro | 39 + .../borderimage/borderimage.qmlproject | 16 - .../imageelements/borderimage/borderimage.svg | 93 +++ .../imageelements/borderimage/content/bw.png | Bin 1357 -> 0 bytes .../borderimage/content/colors-round.sci | 7 - .../borderimage/content/colors-stretch.sci | 5 - .../imageelements/borderimage/content/colors.png | Bin 1655 -> 0 bytes .../imageelements/borderimage/content/shadow.png | Bin 588 -> 0 bytes .../declarative/imageelements/borderimage/main.cpp | 14 + .../imageelements/borderimage/qml/borderimage.qml | 97 +++ .../borderimage/qml/borderimage.qmlproject | 16 + .../borderimage/qml/content/MyBorderImage.qml | 90 +++ .../borderimage/qml/content/ShadowRectangle.qml | 54 ++ .../imageelements/borderimage/qml/content/bw.png | Bin 0 -> 1357 bytes .../borderimage/qml/content/colors-round.sci | 7 + .../borderimage/qml/content/colors-stretch.sci | 5 + .../borderimage/qml/content/colors.png | Bin 0 -> 1655 bytes .../borderimage/qml/content/shadow.png | Bin 0 -> 588 bytes .../imageelements/borderimage/qml/shadows.qml | 64 ++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../qtc_packaging/debian_fremantle/README | 6 + .../qtc_packaging/debian_fremantle/changelog | 5 + .../qtc_packaging/debian_fremantle/compat | 1 + .../qtc_packaging/debian_fremantle/control | 13 + .../qtc_packaging/debian_fremantle/copyright | 40 + .../qtc_packaging/debian_fremantle/rules | 91 +++ .../declarative/imageelements/image/image.desktop | 11 + examples/declarative/imageelements/image/image.png | Bin 0 -> 3400 bytes examples/declarative/imageelements/image/image.pro | 39 + .../imageelements/image/image.qmlproject | 16 - examples/declarative/imageelements/image/image.svg | 93 +++ examples/declarative/imageelements/image/main.cpp | 14 + .../imageelements/image/qml/ImageCell.qml | 60 ++ .../declarative/imageelements/image/qml/image.qml | 66 ++ .../imageelements/image/qml/image.qmlproject | 16 + .../imageelements/image/qml/qt-logo.png | Bin 0 -> 5149 bytes .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../declarative/imageelements/image/qt-logo.png | Bin 5149 -> 0 bytes .../imageelements/imageelements.qmlproject | 16 - .../declarative/imageelements/shadows/main.cpp | 14 + .../imageelements/shadows/qml/borderimage.qml | 97 +++ .../shadows/qml/borderimage.qmlproject | 16 + .../shadows/qml/content/MyBorderImage.qml | 90 +++ .../shadows/qml/content/ShadowRectangle.qml | 54 ++ .../imageelements/shadows/qml/content/bw.png | Bin 0 -> 1357 bytes .../shadows/qml/content/colors-round.sci | 7 + .../shadows/qml/content/colors-stretch.sci | 5 + .../imageelements/shadows/qml/content/colors.png | Bin 0 -> 1655 bytes .../imageelements/shadows/qml/content/shadow.png | Bin 0 -> 588 bytes .../imageelements/shadows/qml/shadows.qml | 64 ++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../imageelements/shadows/shadows.desktop | 11 + .../declarative/imageelements/shadows/shadows.png | Bin 0 -> 3400 bytes .../declarative/imageelements/shadows/shadows.pro | 39 + .../declarative/imageelements/shadows/shadows.svg | 93 +++ .../keyinteraction/focus/Core/images/arrow.png | Bin 583 -> 0 bytes .../keyinteraction/focus/Core/images/qt-logo.png | Bin 5149 -> 0 bytes .../declarative/keyinteraction/focus/focus.desktop | 11 + .../declarative/keyinteraction/focus/focus.png | Bin 0 -> 3400 bytes .../declarative/keyinteraction/focus/focus.pro | 39 + .../keyinteraction/focus/focus.qmlproject | 16 - .../declarative/keyinteraction/focus/focus.svg | 93 +++ examples/declarative/keyinteraction/focus/main.cpp | 14 + .../keyinteraction/focus/qml/Core/ContextMenu.qml | 65 ++ .../keyinteraction/focus/qml/Core/GridMenu.qml | 105 +++ .../keyinteraction/focus/qml/Core/ListMenu.qml | 105 +++ .../focus/qml/Core/ListViewDelegate.qml | 85 ++ .../keyinteraction/focus/qml/Core/images/arrow.png | Bin 0 -> 583 bytes .../focus/qml/Core/images/qt-logo.png | Bin 0 -> 5149 bytes .../declarative/keyinteraction/focus/qml/focus.qml | 111 +++ .../keyinteraction/focus/qml/focus.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../keyinteraction/keyinteraction.qmlproject | 16 - .../modelviews/Delegate/Delegate.desktop | 11 + .../declarative/modelviews/Delegate/Delegate.png | Bin 0 -> 3400 bytes .../declarative/modelviews/Delegate/Delegate.pro | 39 + .../declarative/modelviews/Delegate/Delegate.svg | 93 +++ examples/declarative/modelviews/Delegate/main.cpp | 14 + .../modelviews/Delegate/qml/Delegate.qml | 88 +++ .../modelviews/Delegate/qml/package.qmlproject | 16 + .../declarative/modelviews/Delegate/qml/view.qml | 76 ++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../gridview-example/gridviewexample.desktop | 11 + .../gridview-example/gridviewexample.png | Bin 0 -> 3400 bytes .../gridview-example/gridviewexample.pro | 39 + .../gridview-example/gridviewexample.svg | 93 +++ .../modelviews/gridview-example/main.cpp | 14 + .../gridview-example/qml/gridview-example.qml | 89 +++ .../gridview-example/qml/gridview.qmlproject | 16 + .../gridview-example/qml/pics/AddressBook_48.png | Bin 0 -> 3350 bytes .../gridview-example/qml/pics/AudioPlayer_48.png | Bin 0 -> 3806 bytes .../gridview-example/qml/pics/Camera_48.png | Bin 0 -> 3540 bytes .../gridview-example/qml/pics/DateBook_48.png | Bin 0 -> 2610 bytes .../gridview-example/qml/pics/EMail_48.png | Bin 0 -> 3655 bytes .../gridview-example/qml/pics/TodoList_48.png | Bin 0 -> 3429 bytes .../gridview-example/qml/pics/VideoPlayer_48.png | Bin 0 -> 4151 bytes .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../modelviews/gridview/gridview.qmlproject | 16 - .../modelviews/gridview/pics/AddressBook_48.png | Bin 3350 -> 0 bytes .../modelviews/gridview/pics/AudioPlayer_48.png | Bin 3806 -> 0 bytes .../modelviews/gridview/pics/Camera_48.png | Bin 3540 -> 0 bytes .../modelviews/gridview/pics/DateBook_48.png | Bin 2610 -> 0 bytes .../modelviews/gridview/pics/EMail_48.png | Bin 3655 -> 0 bytes .../modelviews/gridview/pics/TodoList_48.png | Bin 3429 -> 0 bytes .../modelviews/gridview/pics/VideoPlayer_48.png | Bin 4151 -> 0 bytes .../listview/content/pics/fruit-salad.jpg | Bin 17952 -> 0 bytes .../modelviews/listview/content/pics/hamburger.jpg | Bin 8572 -> 0 bytes .../modelviews/listview/content/pics/lemonade.jpg | Bin 6645 -> 0 bytes .../modelviews/listview/content/pics/moreDown.png | Bin 217 -> 0 bytes .../modelviews/listview/content/pics/moreUp.png | Bin 212 -> 0 bytes .../modelviews/listview/content/pics/pancakes.jpg | Bin 9163 -> 0 bytes .../listview/content/pics/vegetable-soup.jpg | Bin 8639 -> 0 bytes .../listview/dynamiclist/dynamiclist.desktop | 11 + .../listview/dynamiclist/dynamiclist.png | Bin 0 -> 3400 bytes .../listview/dynamiclist/dynamiclist.pro | 39 + .../listview/dynamiclist/dynamiclist.svg | 93 +++ .../modelviews/listview/dynamiclist/main.cpp | 14 + .../listview/dynamiclist/qml/content/PetsModel.qml | 98 +++ .../dynamiclist/qml/content/PressAndHoldButton.qml | 82 ++ .../dynamiclist/qml/content/RecipesModel.qml | 129 +++ .../dynamiclist/qml/content/TextButton.qml | 78 ++ .../dynamiclist/qml/content/pics/arrow-down.png | Bin 0 -> 594 bytes .../dynamiclist/qml/content/pics/arrow-up.png | Bin 0 -> 692 bytes .../dynamiclist/qml/content/pics/fruit-salad.jpg | Bin 0 -> 17952 bytes .../dynamiclist/qml/content/pics/hamburger.jpg | Bin 0 -> 8572 bytes .../dynamiclist/qml/content/pics/lemonade.jpg | Bin 0 -> 6645 bytes .../dynamiclist/qml/content/pics/list-delete.png | Bin 0 -> 831 bytes .../dynamiclist/qml/content/pics/minus-sign.png | Bin 0 -> 250 bytes .../dynamiclist/qml/content/pics/moreDown.png | Bin 0 -> 217 bytes .../dynamiclist/qml/content/pics/moreUp.png | Bin 0 -> 212 bytes .../dynamiclist/qml/content/pics/pancakes.jpg | Bin 0 -> 9163 bytes .../dynamiclist/qml/content/pics/plus-sign.png | Bin 0 -> 462 bytes .../qml/content/pics/vegetable-soup.jpg | Bin 0 -> 8639 bytes .../listview/dynamiclist/qml/dynamiclist.qml | 203 +++++ .../dynamiclist/qml/expandingdelegates.qml | 202 +++++ .../listview/dynamiclist/qml/highlight.qml | 99 +++ .../listview/dynamiclist/qml/highlightranges.qml | 122 +++ .../listview/dynamiclist/qml/listview.qmlproject | 16 + .../listview/dynamiclist/qml/sections.qml | 87 +++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../expandingdelegates/expandingdelegates.desktop | 11 + .../expandingdelegates/expandingdelegates.png | Bin 0 -> 3400 bytes .../expandingdelegates/expandingdelegates.pro | 39 + .../expandingdelegates/expandingdelegates.svg | 93 +++ .../listview/expandingdelegates/main.cpp | 14 + .../expandingdelegates/qml/content/PetsModel.qml | 98 +++ .../qml/content/PressAndHoldButton.qml | 82 ++ .../qml/content/RecipesModel.qml | 129 +++ .../expandingdelegates/qml/content/TextButton.qml | 78 ++ .../qml/content/pics/arrow-down.png | Bin 0 -> 594 bytes .../qml/content/pics/arrow-up.png | Bin 0 -> 692 bytes .../qml/content/pics/fruit-salad.jpg | Bin 0 -> 17952 bytes .../qml/content/pics/hamburger.jpg | Bin 0 -> 8572 bytes .../qml/content/pics/lemonade.jpg | Bin 0 -> 6645 bytes .../qml/content/pics/list-delete.png | Bin 0 -> 831 bytes .../qml/content/pics/minus-sign.png | Bin 0 -> 250 bytes .../qml/content/pics/moreDown.png | Bin 0 -> 217 bytes .../expandingdelegates/qml/content/pics/moreUp.png | Bin 0 -> 212 bytes .../qml/content/pics/pancakes.jpg | Bin 0 -> 9163 bytes .../qml/content/pics/plus-sign.png | Bin 0 -> 462 bytes .../qml/content/pics/vegetable-soup.jpg | Bin 0 -> 8639 bytes .../expandingdelegates/qml/dynamiclist.qml | 203 +++++ .../expandingdelegates/qml/expandingdelegates.qml | 202 +++++ .../listview/expandingdelegates/qml/highlight.qml | 99 +++ .../expandingdelegates/qml/highlightranges.qml | 122 +++ .../expandingdelegates/qml/listview.qmlproject | 16 + .../listview/expandingdelegates/qml/sections.qml | 87 +++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../qtc_packaging/debian_fremantle/README | 6 + .../qtc_packaging/debian_fremantle/changelog | 5 + .../qtc_packaging/debian_fremantle/compat | 1 + .../qtc_packaging/debian_fremantle/control | 13 + .../qtc_packaging/debian_fremantle/copyright | 40 + .../qtc_packaging/debian_fremantle/rules | 91 +++ .../listview/highlight/highlight.desktop | 11 + .../modelviews/listview/highlight/highlight.png | Bin 0 -> 3400 bytes .../modelviews/listview/highlight/highlight.pro | 39 + .../modelviews/listview/highlight/highlight.svg | 93 +++ .../modelviews/listview/highlight/main.cpp | 14 + .../listview/highlight/qml/content/PetsModel.qml | 98 +++ .../highlight/qml/content/PressAndHoldButton.qml | 82 ++ .../highlight/qml/content/RecipesModel.qml | 129 +++ .../listview/highlight/qml/content/TextButton.qml | 78 ++ .../highlight/qml/content/pics/arrow-down.png | Bin 0 -> 594 bytes .../highlight/qml/content/pics/arrow-up.png | Bin 0 -> 692 bytes .../highlight/qml/content/pics/fruit-salad.jpg | Bin 0 -> 17952 bytes .../highlight/qml/content/pics/hamburger.jpg | Bin 0 -> 8572 bytes .../highlight/qml/content/pics/lemonade.jpg | Bin 0 -> 6645 bytes .../highlight/qml/content/pics/list-delete.png | Bin 0 -> 831 bytes .../highlight/qml/content/pics/minus-sign.png | Bin 0 -> 250 bytes .../highlight/qml/content/pics/moreDown.png | Bin 0 -> 217 bytes .../listview/highlight/qml/content/pics/moreUp.png | Bin 0 -> 212 bytes .../highlight/qml/content/pics/pancakes.jpg | Bin 0 -> 9163 bytes .../highlight/qml/content/pics/plus-sign.png | Bin 0 -> 462 bytes .../highlight/qml/content/pics/vegetable-soup.jpg | Bin 0 -> 8639 bytes .../listview/highlight/qml/dynamiclist.qml | 203 +++++ .../listview/highlight/qml/expandingdelegates.qml | 202 +++++ .../listview/highlight/qml/highlight.qml | 99 +++ .../listview/highlight/qml/highlightranges.qml | 122 +++ .../listview/highlight/qml/listview.qmlproject | 16 + .../modelviews/listview/highlight/qml/sections.qml | 87 +++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../qtc_packaging/debian_fremantle/README | 6 + .../qtc_packaging/debian_fremantle/changelog | 5 + .../qtc_packaging/debian_fremantle/compat | 1 + .../qtc_packaging/debian_fremantle/control | 13 + .../qtc_packaging/debian_fremantle/copyright | 40 + .../highlight/qtc_packaging/debian_fremantle/rules | 91 +++ .../highlightranges/highlightranges.desktop | 11 + .../listview/highlightranges/highlightranges.png | Bin 0 -> 3400 bytes .../listview/highlightranges/highlightranges.pro | 39 + .../listview/highlightranges/highlightranges.svg | 93 +++ .../modelviews/listview/highlightranges/main.cpp | 14 + .../highlightranges/qml/content/PetsModel.qml | 98 +++ .../qml/content/PressAndHoldButton.qml | 82 ++ .../highlightranges/qml/content/RecipesModel.qml | 129 +++ .../highlightranges/qml/content/TextButton.qml | 78 ++ .../qml/content/pics/arrow-down.png | Bin 0 -> 594 bytes .../highlightranges/qml/content/pics/arrow-up.png | Bin 0 -> 692 bytes .../qml/content/pics/fruit-salad.jpg | Bin 0 -> 17952 bytes .../highlightranges/qml/content/pics/hamburger.jpg | Bin 0 -> 8572 bytes .../highlightranges/qml/content/pics/lemonade.jpg | Bin 0 -> 6645 bytes .../qml/content/pics/list-delete.png | Bin 0 -> 831 bytes .../qml/content/pics/minus-sign.png | Bin 0 -> 250 bytes .../highlightranges/qml/content/pics/moreDown.png | Bin 0 -> 217 bytes .../highlightranges/qml/content/pics/moreUp.png | Bin 0 -> 212 bytes .../highlightranges/qml/content/pics/pancakes.jpg | Bin 0 -> 9163 bytes .../highlightranges/qml/content/pics/plus-sign.png | Bin 0 -> 462 bytes .../qml/content/pics/vegetable-soup.jpg | Bin 0 -> 8639 bytes .../listview/highlightranges/qml/dynamiclist.qml | 203 +++++ .../highlightranges/qml/expandingdelegates.qml | 202 +++++ .../listview/highlightranges/qml/highlight.qml | 99 +++ .../highlightranges/qml/highlightranges.qml | 122 +++ .../highlightranges/qml/listview.qmlproject | 16 + .../listview/highlightranges/qml/sections.qml | 87 +++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../modelviews/listview/listview.qmlproject | 16 - .../modelviews/listview/sections/main.cpp | 14 + .../listview/sections/qml/content/PetsModel.qml | 98 +++ .../sections/qml/content/PressAndHoldButton.qml | 82 ++ .../listview/sections/qml/content/RecipesModel.qml | 129 +++ .../listview/sections/qml/content/TextButton.qml | 78 ++ .../sections/qml/content/pics/arrow-down.png | Bin 0 -> 594 bytes .../sections/qml/content/pics/arrow-up.png | Bin 0 -> 692 bytes .../sections/qml/content/pics/fruit-salad.jpg | Bin 0 -> 17952 bytes .../sections/qml/content/pics/hamburger.jpg | Bin 0 -> 8572 bytes .../sections/qml/content/pics/lemonade.jpg | Bin 0 -> 6645 bytes .../sections/qml/content/pics/list-delete.png | Bin 0 -> 831 bytes .../sections/qml/content/pics/minus-sign.png | Bin 0 -> 250 bytes .../sections/qml/content/pics/moreDown.png | Bin 0 -> 217 bytes .../listview/sections/qml/content/pics/moreUp.png | Bin 0 -> 212 bytes .../sections/qml/content/pics/pancakes.jpg | Bin 0 -> 9163 bytes .../sections/qml/content/pics/plus-sign.png | Bin 0 -> 462 bytes .../sections/qml/content/pics/vegetable-soup.jpg | Bin 0 -> 8639 bytes .../listview/sections/qml/dynamiclist.qml | 203 +++++ .../listview/sections/qml/expandingdelegates.qml | 202 +++++ .../modelviews/listview/sections/qml/highlight.qml | 99 +++ .../listview/sections/qml/highlightranges.qml | 122 +++ .../listview/sections/qml/listview.qmlproject | 16 + .../modelviews/listview/sections/qml/sections.qml | 87 +++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../modelviews/listview/sections/sections.desktop | 11 + .../modelviews/listview/sections/sections.png | Bin 0 -> 3400 bytes .../modelviews/listview/sections/sections.pro | 39 + .../modelviews/listview/sections/sections.svg | 93 +++ .../declarative/modelviews/modelviews.qmlproject | 16 - .../modelviews/package/package.qmlproject | 16 - .../modelviews/pathview-example/main.cpp | 14 + .../pathview-example/pathviewexample.desktop | 11 + .../pathview-example/pathviewexample.png | Bin 0 -> 3400 bytes .../pathview-example/pathviewexample.pro | 39 + .../pathview-example/pathviewexample.svg | 93 +++ .../pathview-example/qml/pathview-example.qml | 109 +++ .../pathview-example/qml/pathview.qmlproject | 16 + .../pathview-example/qml/pics/AddressBook_48.png | Bin 0 -> 3350 bytes .../pathview-example/qml/pics/AudioPlayer_48.png | Bin 0 -> 3806 bytes .../pathview-example/qml/pics/Camera_48.png | Bin 0 -> 3540 bytes .../pathview-example/qml/pics/DateBook_48.png | Bin 0 -> 2610 bytes .../pathview-example/qml/pics/EMail_48.png | Bin 0 -> 3655 bytes .../pathview-example/qml/pics/TodoList_48.png | Bin 0 -> 3429 bytes .../pathview-example/qml/pics/VideoPlayer_48.png | Bin 0 -> 4151 bytes .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../qtc_packaging/debian_fremantle/README | 6 + .../qtc_packaging/debian_fremantle/changelog | 5 + .../qtc_packaging/debian_fremantle/compat | 1 + .../qtc_packaging/debian_fremantle/control | 13 + .../qtc_packaging/debian_fremantle/copyright | 40 + .../qtc_packaging/debian_fremantle/rules | 91 +++ .../modelviews/pathview/pathview.qmlproject | 16 - .../modelviews/pathview/pics/AddressBook_48.png | Bin 3350 -> 0 bytes .../modelviews/pathview/pics/AudioPlayer_48.png | Bin 3806 -> 0 bytes .../modelviews/pathview/pics/Camera_48.png | Bin 3540 -> 0 bytes .../modelviews/pathview/pics/DateBook_48.png | Bin 2610 -> 0 bytes .../modelviews/pathview/pics/EMail_48.png | Bin 3655 -> 0 bytes .../modelviews/pathview/pics/TodoList_48.png | Bin 3429 -> 0 bytes .../modelviews/pathview/pics/VideoPlayer_48.png | Bin 4151 -> 0 bytes .../modelviews/visualitemmodel/main.cpp | 14 + .../visualitemmodel/qml/visualitemmodel.qml | 107 +++ .../visualitemmodel/qml/visualitemmodel.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../visualitemmodel/visualitemmodel.desktop | 11 + .../modelviews/visualitemmodel/visualitemmodel.png | Bin 0 -> 3400 bytes .../modelviews/visualitemmodel/visualitemmodel.pro | 39 + .../visualitemmodel/visualitemmodel.qmlproject | 16 - .../modelviews/visualitemmodel/visualitemmodel.svg | 93 +++ .../declarative/modelviews/webview/alerts.html | 5 - .../modelviews/webview/alerts/alerts.desktop | 11 + .../modelviews/webview/alerts/alerts.png | Bin 0 -> 3400 bytes .../modelviews/webview/alerts/alerts.pro | 39 + .../modelviews/webview/alerts/alerts.svg | 93 +++ .../declarative/modelviews/webview/alerts/main.cpp | 14 + .../modelviews/webview/alerts/qml/alerts.html | 5 + .../modelviews/webview/alerts/qml/alerts.qml | 101 +++ .../modelviews/webview/alerts/qml/autosize.qml | 106 +++ .../webview/alerts/qml/content/Mapping/Map.qml | 73 ++ .../webview/alerts/qml/content/Mapping/map.html | 60 ++ .../webview/alerts/qml/content/pics/cancel.png | Bin 0 -> 1038 bytes .../webview/alerts/qml/content/pics/ok.png | Bin 0 -> 655 bytes .../modelviews/webview/alerts/qml/googlemaps.qml | 83 ++ .../modelviews/webview/alerts/qml/inlinehtml.qml | 55 ++ .../modelviews/webview/alerts/qml/newwindows.html | 3 + .../modelviews/webview/alerts/qml/newwindows.qml | 71 ++ .../webview/alerts/qml/webview.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../modelviews/webview/autosize/autosize.desktop | 11 + .../modelviews/webview/autosize/autosize.png | Bin 0 -> 3400 bytes .../modelviews/webview/autosize/autosize.pro | 39 + .../modelviews/webview/autosize/autosize.svg | 93 +++ .../modelviews/webview/autosize/main.cpp | 14 + .../modelviews/webview/autosize/qml/alerts.html | 5 + .../modelviews/webview/autosize/qml/alerts.qml | 101 +++ .../modelviews/webview/autosize/qml/autosize.qml | 106 +++ .../webview/autosize/qml/content/Mapping/Map.qml | 73 ++ .../webview/autosize/qml/content/Mapping/map.html | 60 ++ .../webview/autosize/qml/content/pics/cancel.png | Bin 0 -> 1038 bytes .../webview/autosize/qml/content/pics/ok.png | Bin 0 -> 655 bytes .../modelviews/webview/autosize/qml/googlemaps.qml | 83 ++ .../modelviews/webview/autosize/qml/inlinehtml.qml | 55 ++ .../webview/autosize/qml/newwindows.html | 3 + .../modelviews/webview/autosize/qml/newwindows.qml | 71 ++ .../webview/autosize/qml/webview.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../autosize/qtc_packaging/debian_fremantle/README | 6 + .../qtc_packaging/debian_fremantle/changelog | 5 + .../autosize/qtc_packaging/debian_fremantle/compat | 1 + .../qtc_packaging/debian_fremantle/control | 13 + .../qtc_packaging/debian_fremantle/copyright | 40 + .../autosize/qtc_packaging/debian_fremantle/rules | 91 +++ .../modelviews/webview/content/Mapping/map.html | 60 -- .../modelviews/webview/content/pics/cancel.png | Bin 1038 -> 0 bytes .../modelviews/webview/content/pics/ok.png | Bin 655 -> 0 bytes .../webview/googlemaps/googlemaps.desktop | 11 + .../modelviews/webview/googlemaps/googlemaps.png | Bin 0 -> 3400 bytes .../modelviews/webview/googlemaps/googlemaps.pro | 39 + .../modelviews/webview/googlemaps/googlemaps.svg | 93 +++ .../modelviews/webview/googlemaps/main.cpp | 14 + .../modelviews/webview/googlemaps/qml/alerts.html | 5 + .../modelviews/webview/googlemaps/qml/alerts.qml | 101 +++ .../modelviews/webview/googlemaps/qml/autosize.qml | 106 +++ .../webview/googlemaps/qml/content/Mapping/Map.qml | 73 ++ .../googlemaps/qml/content/Mapping/map.html | 60 ++ .../webview/googlemaps/qml/content/pics/cancel.png | Bin 0 -> 1038 bytes .../webview/googlemaps/qml/content/pics/ok.png | Bin 0 -> 655 bytes .../webview/googlemaps/qml/googlemaps.qml | 83 ++ .../webview/googlemaps/qml/inlinehtml.qml | 55 ++ .../webview/googlemaps/qml/newwindows.html | 3 + .../webview/googlemaps/qml/newwindows.qml | 71 ++ .../webview/googlemaps/qml/webview.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../qtc_packaging/debian_fremantle/README | 6 + .../qtc_packaging/debian_fremantle/changelog | 5 + .../qtc_packaging/debian_fremantle/compat | 1 + .../qtc_packaging/debian_fremantle/control | 13 + .../qtc_packaging/debian_fremantle/copyright | 40 + .../qtc_packaging/debian_fremantle/rules | 91 +++ .../webview/inlinehtml/inlinehtml.desktop | 11 + .../modelviews/webview/inlinehtml/inlinehtml.png | Bin 0 -> 3400 bytes .../modelviews/webview/inlinehtml/inlinehtml.pro | 39 + .../modelviews/webview/inlinehtml/inlinehtml.svg | 93 +++ .../modelviews/webview/inlinehtml/main.cpp | 14 + .../modelviews/webview/inlinehtml/qml/alerts.html | 5 + .../modelviews/webview/inlinehtml/qml/alerts.qml | 101 +++ .../modelviews/webview/inlinehtml/qml/autosize.qml | 106 +++ .../webview/inlinehtml/qml/content/Mapping/Map.qml | 73 ++ .../inlinehtml/qml/content/Mapping/map.html | 60 ++ .../webview/inlinehtml/qml/content/pics/cancel.png | Bin 0 -> 1038 bytes .../webview/inlinehtml/qml/content/pics/ok.png | Bin 0 -> 655 bytes .../webview/inlinehtml/qml/googlemaps.qml | 83 ++ .../webview/inlinehtml/qml/inlinehtml.qml | 55 ++ .../webview/inlinehtml/qml/newwindows.html | 3 + .../webview/inlinehtml/qml/newwindows.qml | 71 ++ .../webview/inlinehtml/qml/webview.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../qtc_packaging/debian_fremantle/README | 6 + .../qtc_packaging/debian_fremantle/changelog | 5 + .../qtc_packaging/debian_fremantle/compat | 1 + .../qtc_packaging/debian_fremantle/control | 13 + .../qtc_packaging/debian_fremantle/copyright | 40 + .../qtc_packaging/debian_fremantle/rules | 91 +++ .../declarative/modelviews/webview/newwindows.html | 3 - .../modelviews/webview/newwindows/main.cpp | 14 + .../webview/newwindows/newwindows.desktop | 11 + .../modelviews/webview/newwindows/newwindows.png | Bin 0 -> 3400 bytes .../modelviews/webview/newwindows/newwindows.pro | 39 + .../modelviews/webview/newwindows/newwindows.svg | 93 +++ .../modelviews/webview/newwindows/qml/alerts.html | 5 + .../modelviews/webview/newwindows/qml/alerts.qml | 101 +++ .../modelviews/webview/newwindows/qml/autosize.qml | 106 +++ .../webview/newwindows/qml/content/Mapping/Map.qml | 73 ++ .../newwindows/qml/content/Mapping/map.html | 60 ++ .../webview/newwindows/qml/content/pics/cancel.png | Bin 0 -> 1038 bytes .../webview/newwindows/qml/content/pics/ok.png | Bin 0 -> 655 bytes .../webview/newwindows/qml/googlemaps.qml | 83 ++ .../webview/newwindows/qml/inlinehtml.qml | 55 ++ .../webview/newwindows/qml/newwindows.html | 3 + .../webview/newwindows/qml/newwindows.qml | 71 ++ .../webview/newwindows/qml/webview.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../modelviews/webview/webview.qmlproject | 16 - examples/declarative/positioners/add.png | Bin 810 -> 0 bytes examples/declarative/positioners/del.png | Bin 488 -> 0 bytes examples/declarative/positioners/main.cpp | 14 + .../declarative/positioners/positioners.desktop | 11 + examples/declarative/positioners/positioners.png | Bin 0 -> 3400 bytes examples/declarative/positioners/positioners.pro | 39 + .../declarative/positioners/positioners.qmlproject | 18 - examples/declarative/positioners/positioners.svg | 93 +++ examples/declarative/positioners/qml/Button.qml | 78 ++ examples/declarative/positioners/qml/add.png | Bin 0 -> 810 bytes examples/declarative/positioners/qml/del.png | Bin 0 -> 488 bytes .../declarative/positioners/qml/positioners.qml | 253 ++++++ .../positioners/qml/positioners.qmlproject | 18 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../sqllocalstorage/sqllocalstorage.qmlproject | 16 - .../fonts/availableFonts/availableFonts.desktop | 11 + .../text/fonts/availableFonts/availableFonts.png | Bin 0 -> 3400 bytes .../text/fonts/availableFonts/availableFonts.pro | 39 + .../text/fonts/availableFonts/availableFonts.svg | 93 +++ .../declarative/text/fonts/availableFonts/main.cpp | 14 + .../fonts/availableFonts/qml/availableFonts.qml | 57 ++ .../text/fonts/availableFonts/qml/banner.qml | 61 ++ .../text/fonts/availableFonts/qml/fonts.qml | 104 +++ .../text/fonts/availableFonts/qml/fonts.qmlproject | 16 + .../availableFonts/qml/fonts/tarzeau_ocr_a.ttf | Bin 0 -> 24544 bytes .../text/fonts/availableFonts/qml/hello.qml | 79 ++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../declarative/text/fonts/banner/banner.desktop | 11 + examples/declarative/text/fonts/banner/banner.png | Bin 0 -> 3400 bytes examples/declarative/text/fonts/banner/banner.pro | 39 + examples/declarative/text/fonts/banner/banner.svg | 93 +++ examples/declarative/text/fonts/banner/main.cpp | 14 + .../text/fonts/banner/qml/availableFonts.qml | 57 ++ .../declarative/text/fonts/banner/qml/banner.qml | 61 ++ .../declarative/text/fonts/banner/qml/fonts.qml | 104 +++ .../text/fonts/banner/qml/fonts.qmlproject | 16 + .../text/fonts/banner/qml/fonts/tarzeau_ocr_a.ttf | Bin 0 -> 24544 bytes .../declarative/text/fonts/banner/qml/hello.qml | 79 ++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ examples/declarative/text/fonts/fonts.qmlproject | 16 - .../declarative/text/fonts/fonts/fonts.desktop | 11 + examples/declarative/text/fonts/fonts/fonts.png | Bin 0 -> 3400 bytes examples/declarative/text/fonts/fonts/fonts.pro | 39 + examples/declarative/text/fonts/fonts/fonts.svg | 93 +++ examples/declarative/text/fonts/fonts/main.cpp | 14 + .../text/fonts/fonts/qml/availableFonts.qml | 57 ++ .../declarative/text/fonts/fonts/qml/banner.qml | 61 ++ .../declarative/text/fonts/fonts/qml/fonts.qml | 104 +++ .../text/fonts/fonts/qml/fonts.qmlproject | 16 + .../text/fonts/fonts/qml/fonts/tarzeau_ocr_a.ttf | Bin 0 -> 24544 bytes .../declarative/text/fonts/fonts/qml/hello.qml | 79 ++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../declarative/text/fonts/fonts/tarzeau_ocr_a.ttf | Bin 24544 -> 0 bytes .../declarative/text/fonts/hello/hello.desktop | 11 + examples/declarative/text/fonts/hello/hello.png | Bin 0 -> 3400 bytes examples/declarative/text/fonts/hello/hello.pro | 39 + examples/declarative/text/fonts/hello/hello.svg | 93 +++ examples/declarative/text/fonts/hello/main.cpp | 14 + .../text/fonts/hello/qml/availableFonts.qml | 57 ++ .../declarative/text/fonts/hello/qml/banner.qml | 61 ++ .../declarative/text/fonts/hello/qml/fonts.qml | 104 +++ .../text/fonts/hello/qml/fonts.qmlproject | 16 + .../text/fonts/hello/qml/fonts/tarzeau_ocr_a.ttf | Bin 0 -> 24544 bytes .../declarative/text/fonts/hello/qml/hello.qml | 79 ++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ examples/declarative/text/text.qmlproject | 16 - examples/declarative/text/textselection/main.cpp | 14 + .../text/textselection/pics/endHandle.png | Bin 185 -> 0 bytes .../text/textselection/pics/endHandle.sci | 5 - .../text/textselection/pics/startHandle.png | Bin 178 -> 0 bytes .../text/textselection/pics/startHandle.sci | 5 - .../text/textselection/qml/pics/endHandle.png | Bin 0 -> 185 bytes .../text/textselection/qml/pics/endHandle.sci | 5 + .../text/textselection/qml/pics/startHandle.png | Bin 0 -> 178 bytes .../text/textselection/qml/pics/startHandle.sci | 5 + .../text/textselection/qml/textselection.qml | 290 +++++++ .../textselection/qml/textselection.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../text/textselection/textselection.desktop | 11 + .../text/textselection/textselection.png | Bin 0 -> 3400 bytes .../text/textselection/textselection.pro | 39 + .../text/textselection/textselection.qmlproject | 16 - .../text/textselection/textselection.svg | 93 +++ .../declarative/threading/threading.qmlproject | 16 - .../experimentalgestures.desktop | 11 + .../experimental-gestures/experimentalgestures.png | Bin 0 -> 3400 bytes .../experimental-gestures/experimentalgestures.pro | 39 + .../experimental-gestures/experimentalgestures.svg | 93 +++ .../gestures/experimental-gestures/main.cpp | 14 + .../qml/experimental-gestures.qml | 76 ++ .../experimental-gestures/qml/gestures.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../touchinteraction/gestures/gestures.qmlproject | 16 - .../mousearea/mousearea-example/main.cpp | 14 + .../mousearea-example/mouseareaexample.desktop | 11 + .../mousearea-example/mouseareaexample.png | Bin 0 -> 3400 bytes .../mousearea-example/mouseareaexample.pro | 39 + .../mousearea-example/mouseareaexample.svg | 93 +++ .../mousearea-example/qml/mousearea-example.qml | 112 +++ .../mousearea-example/qml/mousearea.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../mousearea/mousearea.qmlproject | 16 - .../touchinteraction/touchinteraction.qmlproject | 16 - examples/declarative/toys/README | 37 - examples/declarative/toys/clocks/clocks.desktop | 11 + examples/declarative/toys/clocks/clocks.png | Bin 0 -> 3400 bytes examples/declarative/toys/clocks/clocks.pro | 39 + examples/declarative/toys/clocks/clocks.qmlproject | 16 - examples/declarative/toys/clocks/clocks.svg | 93 +++ examples/declarative/toys/clocks/main.cpp | 14 + examples/declarative/toys/clocks/qml/clocks.qml | 59 ++ .../declarative/toys/clocks/qml/clocks.qmlproject | 16 + .../declarative/toys/clocks/qml/content/Clock.qml | 124 +++ .../toys/clocks/qml/content/QuitButton.qml | 52 ++ .../toys/clocks/qml/content/background.png | Bin 0 -> 46895 bytes .../declarative/toys/clocks/qml/content/center.png | Bin 0 -> 765 bytes .../toys/clocks/qml/content/clock-night.png | Bin 0 -> 23359 bytes .../declarative/toys/clocks/qml/content/clock.png | Bin 0 -> 20653 bytes .../declarative/toys/clocks/qml/content/hour.png | Bin 0 -> 625 bytes .../declarative/toys/clocks/qml/content/minute.png | Bin 0 -> 625 bytes .../declarative/toys/clocks/qml/content/quit.png | Bin 0 -> 583 bytes .../declarative/toys/clocks/qml/content/second.png | Bin 0 -> 303 bytes .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ examples/declarative/toys/corkboards/cork.jpg | Bin 149337 -> 0 bytes .../declarative/toys/corkboards/corkboards.desktop | 11 + .../declarative/toys/corkboards/corkboards.png | Bin 0 -> 3400 bytes .../declarative/toys/corkboards/corkboards.pro | 39 + .../toys/corkboards/corkboards.qmlproject | 16 - .../declarative/toys/corkboards/corkboards.svg | 93 +++ examples/declarative/toys/corkboards/main.cpp | 14 + .../declarative/toys/corkboards/note-yellow.png | Bin 54559 -> 0 bytes examples/declarative/toys/corkboards/qml/Day.qml | 153 ++++ examples/declarative/toys/corkboards/qml/cork.jpg | Bin 0 -> 149337 bytes .../declarative/toys/corkboards/qml/corkboards.qml | 115 +++ .../toys/corkboards/qml/corkboards.qmlproject | 16 + .../toys/corkboards/qml/note-yellow.png | Bin 0 -> 54559 bytes examples/declarative/toys/corkboards/qml/tack.png | Bin 0 -> 7282 bytes .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ examples/declarative/toys/corkboards/tack.png | Bin 7282 -> 0 bytes .../toys/dynamicscene/dynamicscene.desktop | 11 + .../declarative/toys/dynamicscene/dynamicscene.png | Bin 0 -> 3400 bytes .../declarative/toys/dynamicscene/dynamicscene.pro | 39 + .../toys/dynamicscene/dynamicscene.qmlproject | 16 - .../declarative/toys/dynamicscene/dynamicscene.svg | 93 +++ examples/declarative/toys/dynamicscene/images/NOTE | 1 - .../toys/dynamicscene/images/face-smile.png | Bin 15408 -> 0 bytes .../declarative/toys/dynamicscene/images/moon.png | Bin 1757 -> 0 bytes .../toys/dynamicscene/images/rabbit_brown.png | Bin 1245 -> 0 bytes .../toys/dynamicscene/images/rabbit_bw.png | Bin 1759 -> 0 bytes .../declarative/toys/dynamicscene/images/star.png | Bin 349 -> 0 bytes .../declarative/toys/dynamicscene/images/sun.png | Bin 8153 -> 0 bytes .../toys/dynamicscene/images/tree_s.png | Bin 3406 -> 0 bytes examples/declarative/toys/dynamicscene/main.cpp | 14 + .../toys/dynamicscene/qml/dynamicscene.qml | 223 ++++++ .../toys/dynamicscene/qml/dynamicscene.qmlproject | 16 + .../declarative/toys/dynamicscene/qml/images/NOTE | 1 + .../toys/dynamicscene/qml/images/face-smile.png | Bin 0 -> 15408 bytes .../toys/dynamicscene/qml/images/moon.png | Bin 0 -> 1757 bytes .../toys/dynamicscene/qml/images/rabbit_brown.png | Bin 0 -> 1245 bytes .../toys/dynamicscene/qml/images/rabbit_bw.png | Bin 0 -> 1759 bytes .../toys/dynamicscene/qml/images/star.png | Bin 0 -> 349 bytes .../toys/dynamicscene/qml/images/sun.png | Bin 0 -> 8153 bytes .../toys/dynamicscene/qml/images/tree_s.png | Bin 0 -> 3406 bytes .../toys/dynamicscene/qml/itemCreation.js | 62 -- .../toys/dynamicscene/qml/qml/Button.qml | 80 ++ .../toys/dynamicscene/qml/qml/GenericSceneItem.qml | 49 ++ .../toys/dynamicscene/qml/qml/PaletteItem.qml | 59 ++ .../toys/dynamicscene/qml/qml/PerspectiveItem.qml | 65 ++ .../declarative/toys/dynamicscene/qml/qml/Sun.qml | 78 ++ .../toys/dynamicscene/qml/qml/itemCreation.js | 62 ++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../toys/tic-tac-toe/content/pics/board.png | Bin 12258 -> 0 bytes .../toys/tic-tac-toe/content/pics/o.png | Bin 1470 -> 0 bytes .../toys/tic-tac-toe/content/pics/x.png | Bin 1331 -> 0 bytes .../toys/tic-tac-toe/content/tic-tac-toe.js | 149 ---- examples/declarative/toys/tic-tac-toe/main.cpp | 14 + .../toys/tic-tac-toe/qml/content/Button.qml | 79 ++ .../toys/tic-tac-toe/qml/content/TicTac.qml | 60 ++ .../toys/tic-tac-toe/qml/content/pics/board.png | Bin 0 -> 12258 bytes .../toys/tic-tac-toe/qml/content/pics/o.png | Bin 0 -> 1470 bytes .../toys/tic-tac-toe/qml/content/pics/x.png | Bin 0 -> 1331 bytes .../toys/tic-tac-toe/qml/content/tic-tac-toe.js | 149 ++++ .../toys/tic-tac-toe/qml/tic-tac-toe.qml | 123 +++ .../toys/tic-tac-toe/qml/tic-tac-toe.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../toys/tic-tac-toe/tic-tac-toe.qmlproject | 16 - .../declarative/toys/tic-tac-toe/tictactoe.desktop | 11 + .../declarative/toys/tic-tac-toe/tictactoe.png | Bin 0 -> 3400 bytes .../declarative/toys/tic-tac-toe/tictactoe.pro | 39 + .../declarative/toys/tic-tac-toe/tictactoe.svg | 93 +++ examples/declarative/toys/toys.qmlproject | 16 - examples/declarative/toys/tvtennis/main.cpp | 14 + .../declarative/toys/tvtennis/qml/tvtennis.qml | 109 +++ .../toys/tvtennis/qml/tvtennis.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../declarative/toys/tvtennis/tvtennis.desktop | 11 + examples/declarative/toys/tvtennis/tvtennis.png | Bin 0 -> 3400 bytes examples/declarative/toys/tvtennis/tvtennis.pro | 39 + .../declarative/toys/tvtennis/tvtennis.qmlproject | 16 - examples/declarative/toys/tvtennis/tvtennis.svg | 93 +++ .../chapter6-plugins/chapter6-plugins.pro | 1 + examples/declarative/ui-components/README | 39 - .../dialcontrol/content/background.png | Bin 35876 -> 0 bytes .../ui-components/dialcontrol/content/needle.png | Bin 342 -> 0 bytes .../dialcontrol/content/needle_shadow.png | Bin 632 -> 0 bytes .../ui-components/dialcontrol/content/overlay.png | Bin 3564 -> 0 bytes .../ui-components/dialcontrol/content/quit.png | Bin 583 -> 0 bytes .../ui-components/dialcontrol/dialcontrol.desktop | 11 + .../ui-components/dialcontrol/dialcontrol.png | Bin 0 -> 3400 bytes .../ui-components/dialcontrol/dialcontrol.pro | 39 + .../dialcontrol/dialcontrol.qmlproject | 16 - .../ui-components/dialcontrol/dialcontrol.svg | 93 +++ .../declarative/ui-components/dialcontrol/main.cpp | 14 + .../ui-components/dialcontrol/qml/content/Dial.qml | 86 ++ .../dialcontrol/qml/content/QuitButton.qml | 52 ++ .../dialcontrol/qml/content/background.png | Bin 0 -> 35876 bytes .../dialcontrol/qml/content/needle.png | Bin 0 -> 342 bytes .../dialcontrol/qml/content/needle_shadow.png | Bin 0 -> 632 bytes .../dialcontrol/qml/content/overlay.png | Bin 0 -> 3564 bytes .../ui-components/dialcontrol/qml/content/quit.png | Bin 0 -> 583 bytes .../ui-components/dialcontrol/qml/dialcontrol.qml | 98 +++ .../dialcontrol/qml/dialcontrol.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../ui-components/flipable/content/5_heart.png | Bin 3872 -> 0 bytes .../ui-components/flipable/content/9_club.png | Bin 6135 -> 0 bytes .../ui-components/flipable/content/back.png | Bin 1418 -> 0 bytes .../ui-components/flipable/flipable.desktop | 11 + .../ui-components/flipable/flipable.png | Bin 0 -> 3400 bytes .../ui-components/flipable/flipable.pro | 39 + .../ui-components/flipable/flipable.qmlproject | 16 - .../ui-components/flipable/flipable.svg | 93 +++ .../declarative/ui-components/flipable/main.cpp | 14 + .../ui-components/flipable/qml/content/5_heart.png | Bin 0 -> 3872 bytes .../ui-components/flipable/qml/content/9_club.png | Bin 0 -> 6135 bytes .../ui-components/flipable/qml/content/Card.qml | 80 ++ .../ui-components/flipable/qml/content/back.png | Bin 0 -> 1418 bytes .../ui-components/flipable/qml/flipable.qml | 55 ++ .../ui-components/flipable/qml/flipable.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ examples/declarative/ui-components/main/main.cpp | 14 + .../declarative/ui-components/main/main.desktop | 11 + examples/declarative/ui-components/main/main.png | Bin 0 -> 3400 bytes examples/declarative/ui-components/main/main.pro | 39 + examples/declarative/ui-components/main/main.svg | 93 +++ .../ui-components/main/qml/ScrollBar.qml | 74 ++ .../ui-components/main/qml/SearchBox.qml | 109 +++ .../ui-components/main/qml/TabWidget.qml | 102 +++ .../ui-components/main/qml/content/ProgressBar.qml | 83 ++ .../ui-components/main/qml/content/Spinner.qml | 70 ++ .../ui-components/main/qml/content/background.png | Bin 0 -> 426 bytes .../ui-components/main/qml/content/spinner-bg.png | Bin 0 -> 345 bytes .../main/qml/content/spinner-select.png | Bin 0 -> 320 bytes .../ui-components/main/qml/images/clear.png | Bin 0 -> 429 bytes .../main/qml/images/lineedit-bg-focus.png | Bin 0 -> 526 bytes .../ui-components/main/qml/images/lineedit-bg.png | Bin 0 -> 426 bytes .../declarative/ui-components/main/qml/main.qml | 99 +++ .../ui-components/main/qml/pics/niagara_falls.jpg | Bin 0 -> 604121 bytes .../ui-components/main/qml/progressbar.qmlproject | 16 + .../ui-components/main/qml/scrollbar.qmlproject | 16 + .../ui-components/main/qml/searchbox.qmlproject | 16 + .../ui-components/main/qml/spinner.qmlproject | 16 + .../declarative/ui-components/main/qml/tab.png | Bin 0 -> 507 bytes .../ui-components/main/qml/tabwidget.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../progressbar/content/background.png | Bin 426 -> 0 bytes .../declarative/ui-components/progressbar/main.cpp | 14 + .../ui-components/progressbar/progressbar.desktop | 11 + .../ui-components/progressbar/progressbar.png | Bin 0 -> 3400 bytes .../ui-components/progressbar/progressbar.pro | 39 + .../progressbar/progressbar.qmlproject | 16 - .../ui-components/progressbar/progressbar.svg | 93 +++ .../progressbar/qml/content/ProgressBar.qml | 83 ++ .../progressbar/qml/content/background.png | Bin 0 -> 426 bytes .../ui-components/progressbar/qml/main.qml | 73 ++ .../progressbar/qml/progressbar.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../ui-components/scrollbar/pics/niagara_falls.jpg | Bin 604121 -> 0 bytes .../ui-components/scrollbar/scrollbar.qmlproject | 16 - .../ui-components/searchbox/images/clear.png | Bin 429 -> 0 bytes .../searchbox/images/lineedit-bg-focus.png | Bin 526 -> 0 bytes .../ui-components/searchbox/images/lineedit-bg.png | Bin 426 -> 0 bytes .../ui-components/searchbox/searchbox.qmlproject | 16 - .../slideswitch/content/background.svg | 23 - .../ui-components/slideswitch/content/knob.svg | 867 --------------------- .../declarative/ui-components/slideswitch/main.cpp | 14 + .../slideswitch/qml/content/Switch.qml | 117 +++ .../slideswitch/qml/content/background.svg | 23 + .../ui-components/slideswitch/qml/content/knob.svg | 867 +++++++++++++++++++++ .../ui-components/slideswitch/qml/slideswitch.qml | 51 ++ .../slideswitch/qml/slideswitch.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../qtc_packaging/debian_fremantle/README | 6 + .../qtc_packaging/debian_fremantle/changelog | 5 + .../qtc_packaging/debian_fremantle/compat | 1 + .../qtc_packaging/debian_fremantle/control | 13 + .../qtc_packaging/debian_fremantle/copyright | 40 + .../qtc_packaging/debian_fremantle/rules | 91 +++ .../ui-components/slideswitch/slideswitch.desktop | 11 + .../ui-components/slideswitch/slideswitch.png | Bin 0 -> 3400 bytes .../ui-components/slideswitch/slideswitch.pro | 39 + .../slideswitch/slideswitch.qmlproject | 16 - .../ui-components/slideswitch/slideswitch.svg | 93 +++ .../ui-components/spinner/content/spinner-bg.png | Bin 345 -> 0 bytes .../spinner/content/spinner-select.png | Bin 320 -> 0 bytes .../ui-components/spinner/spinner.qmlproject | 16 - .../declarative/ui-components/tabwidget/tab.png | Bin 507 -> 0 bytes .../ui-components/tabwidget/tabwidget.qmlproject | 16 - .../ui-components/ui-components.qmlproject | 16 - examples/declarative/xml/xml.qmlproject | 16 - .../xml/xmlhttprequest-example/main.cpp | 14 + .../xml/xmlhttprequest-example/qml/data.xml | 5 + .../qml/xmlhttprequest-example.qml | 95 +++ .../qml/xmlhttprequest.qmlproject | 16 + .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 ++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 39 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ++++ .../xmlhttprequestexample.desktop | 11 + .../xmlhttprequestexample.png | Bin 0 -> 3400 bytes .../xmlhttprequestexample.pro | 39 + .../xmlhttprequestexample.svg | 93 +++ examples/declarative/xml/xmlhttprequest/data.xml | 5 - .../xml/xmlhttprequest/xmlhttprequest.qmlproject | 16 - .../calculatorbuilder/calculatorbuilder.desktop | 11 + .../calculatorbuilder/calculatorbuilder.pro | 4 + .../designer/calculatorform/calculatorform.desktop | 11 + .../designer/calculatorform/calculatorform.pro | 5 + .../containerextension/containerextension.desktop | 11 + .../containerextension/containerextension.pro | 4 + .../customwidgetplugin/customwidgetplugin.desktop | 11 + .../customwidgetplugin/customwidgetplugin.pro | 4 + examples/designer/designer.pro | 1 - .../taskmenuextension/taskmenuextension.desktop | 11 + .../taskmenuextension/taskmenuextension.pro | 4 + .../worldtimeclockbuilder.desktop | 11 + .../worldtimeclockbuilder.pro | 4 + .../worldtimeclockplugin/worldtimeclockplugin.pro | 1 + examples/desktop/desktop.pro | 1 + examples/desktop/screenshot/screenshot.desktop | 11 + examples/desktop/screenshot/screenshot.pro | 4 + examples/desktop/systray/systray.desktop | 11 + examples/desktop/systray/systray.pro | 5 + examples/dialogs/classwizard/classwizard.desktop | 11 + examples/dialogs/classwizard/classwizard.pro | 4 + examples/dialogs/configdialog/configdialog.desktop | 11 + examples/dialogs/configdialog/configdialog.pro | 4 + examples/dialogs/dialogs.pro | 1 + examples/dialogs/extension/extension.desktop | 11 + examples/dialogs/extension/extension.pro | 2 + examples/dialogs/extension/finddialog.cpp | 45 +- examples/dialogs/extension/main.cpp | 9 +- examples/dialogs/findfiles/findfiles.desktop | 11 + examples/dialogs/findfiles/findfiles.pro | 1 + examples/dialogs/findfiles/main.cpp | 4 + examples/dialogs/findfiles/window.cpp | 23 +- examples/dialogs/findfiles/window.h | 4 +- .../dialogs/licensewizard/licensewizard.desktop | 11 + examples/dialogs/licensewizard/licensewizard.pro | 4 + examples/dialogs/sipdialog/sipdialog.desktop | 11 + examples/dialogs/sipdialog/sipdialog.pro | 5 +- examples/dialogs/standarddialogs/dialog.cpp | 15 +- examples/dialogs/standarddialogs/dialog.h | 4 +- examples/dialogs/standarddialogs/main.cpp | 8 +- .../standarddialogs/standarddialogs.desktop | 11 + .../dialogs/standarddialogs/standarddialogs.pro | 1 + examples/dialogs/tabdialog/main.cpp | 8 +- examples/dialogs/tabdialog/tabdialog.cpp | 1 + examples/dialogs/tabdialog/tabdialog.desktop | 11 + examples/dialogs/tabdialog/tabdialog.pro | 3 + examples/dialogs/trivialwizard/trivialwizard.cpp | 4 + .../dialogs/trivialwizard/trivialwizard.desktop | 11 + examples/dialogs/trivialwizard/trivialwizard.pro | 3 + .../delayedencoding/delayedencoding.desktop | 11 + .../delayedencoding/delayedencoding.pro | 9 +- examples/draganddrop/delayedencoding/main.cpp | 4 + .../draganddrop/delayedencoding/sourcewidget.cpp | 1 + .../draggableicons/draggableicons.desktop | 11 + .../draganddrop/draggableicons/draggableicons.pro | 1 + examples/draganddrop/draggableicons/dragwidget.cpp | 9 +- examples/draganddrop/draggableicons/main.cpp | 4 + .../draggabletext/draggabletext.desktop | 11 + .../draganddrop/draggabletext/draggabletext.pro | 2 + examples/draganddrop/draggabletext/dragwidget.cpp | 4 +- examples/draganddrop/draggabletext/main.cpp | 4 + examples/draganddrop/dropsite/dropsite.desktop | 11 + examples/draganddrop/dropsite/dropsite.pro | 4 + examples/draganddrop/fridgemagnets/dragwidget.cpp | 4 + .../fridgemagnets/fridgemagnets.desktop | 11 + .../draganddrop/fridgemagnets/fridgemagnets.pro | 2 +- examples/draganddrop/fridgemagnets/main.cpp | 5 + examples/draganddrop/puzzle/main.cpp | 4 + examples/draganddrop/puzzle/mainwindow.cpp | 16 +- examples/draganddrop/puzzle/pieceslist.cpp | 6 +- examples/draganddrop/puzzle/pieceslist.h | 4 +- examples/draganddrop/puzzle/puzzle.desktop | 11 + examples/draganddrop/puzzle/puzzle.pro | 1 + examples/draganddrop/puzzle/puzzlewidget.cpp | 26 +- examples/draganddrop/puzzle/puzzlewidget.h | 6 +- examples/effects/blurpicker/blurpicker.cpp | 32 +- examples/effects/blurpicker/blurpicker.desktop | 11 + examples/effects/blurpicker/blurpicker.h | 2 + examples/effects/blurpicker/blurpicker.pro | 3 + examples/effects/blurpicker/main.cpp | 5 + examples/effects/fademessage/fademessage.cpp | 11 +- examples/effects/fademessage/fademessage.desktop | 11 + examples/effects/fademessage/fademessage.pro | 4 +- examples/effects/fademessage/main.cpp | 4 + examples/effects/lighting/lighting.cpp | 6 + examples/effects/lighting/lighting.desktop | 11 + examples/effects/lighting/lighting.h | 3 + examples/effects/lighting/lighting.pro | 4 + examples/effects/lighting/main.cpp | 5 + examples/examples.pro | 1 - .../gestures/imagegestures/imagegestures.desktop | 11 + examples/gestures/imagegestures/imagegestures.pro | 4 + .../graphicsview/anchorlayout/anchorlayout.desktop | 11 + .../graphicsview/anchorlayout/anchorlayout.pro | 5 + examples/graphicsview/anchorlayout/main.cpp | 5 + .../basicgraphicslayouts.desktop | 11 + .../basicgraphicslayouts/basicgraphicslayouts.pro | 2 + .../graphicsview/basicgraphicslayouts/main.cpp | 4 + .../collidingmice/collidingmice.desktop | 11 + .../graphicsview/collidingmice/collidingmice.pro | 2 + examples/graphicsview/collidingmice/main.cpp | 4 + .../graphicsview/diagramscene/diagramscene.desktop | 11 + .../graphicsview/diagramscene/diagramscene.pro | 4 + .../dragdroprobot/dragdroprobot.desktop | 11 + .../graphicsview/dragdroprobot/dragdroprobot.pro | 3 + examples/graphicsview/dragdroprobot/main.cpp | 24 +- examples/graphicsview/elasticnodes/edge.cpp | 2 +- .../graphicsview/elasticnodes/elasticnodes.desktop | 11 + .../graphicsview/elasticnodes/elasticnodes.pro | 3 + examples/graphicsview/elasticnodes/graphwidget.cpp | 29 +- examples/graphicsview/elasticnodes/graphwidget.h | 5 + examples/graphicsview/elasticnodes/main.cpp | 15 +- examples/graphicsview/elasticnodes/node.cpp | 15 +- .../graphicsview/flowlayout/flowlayout.desktop | 11 + examples/graphicsview/flowlayout/flowlayout.pro | 5 +- examples/graphicsview/flowlayout/main.cpp | 6 + examples/graphicsview/graphicsview.pro | 1 - examples/graphicsview/padnavigator/main.cpp | 5 +- .../graphicsview/padnavigator/padnavigator.desktop | 11 + .../graphicsview/padnavigator/padnavigator.pro | 3 + .../graphicsview/portedasteroids/animateditem.cpp | 11 +- .../graphicsview/portedasteroids/animateditem.h | 18 +- examples/graphicsview/portedasteroids/ledmeter.cpp | 40 +- examples/graphicsview/portedasteroids/ledmeter.h | 12 +- examples/graphicsview/portedasteroids/main.cpp | 4 + .../portedasteroids/portedasteroids.desktop | 11 + .../portedasteroids/portedasteroids.pro | 13 +- examples/graphicsview/portedasteroids/sprites.h | 2 +- examples/graphicsview/portedasteroids/toplevel.cpp | 85 +- examples/graphicsview/portedasteroids/toplevel.h | 15 +- examples/graphicsview/portedasteroids/view.cpp | 270 ++++--- examples/graphicsview/portedasteroids/view.h | 21 +- examples/graphicsview/portedcanvas/canvas.cpp | 259 +++--- examples/graphicsview/portedcanvas/canvas.h | 14 +- examples/graphicsview/portedcanvas/main.cpp | 23 +- .../graphicsview/portedcanvas/portedcanvas.desktop | 11 + .../graphicsview/portedcanvas/portedcanvas.pro | 4 +- examples/graphicsview/simpleanchorlayout/main.cpp | 7 + .../simpleanchorlayout/simpleanchorlayout.desktop | 11 + .../simpleanchorlayout/simpleanchorlayout.pro | 4 + examples/graphicsview/weatheranchorlayout/main.cpp | 23 + .../weatheranchorlayout.desktop | 11 + .../weatheranchorlayout/weatheranchorlayout.pro | 3 + .../contextsensitivehelp.desktop | 11 + .../contextsensitivehelp/contextsensitivehelp.pro | 5 + examples/help/help.pro | 1 - examples/help/remotecontrol/remotecontrol.desktop | 11 + examples/help/remotecontrol/remotecontrol.pro | 5 + .../help/simpletextviewer/simpletextviewer.desktop | 11 + .../help/simpletextviewer/simpletextviewer.pro | 4 + examples/ipc/ipc.pro | 1 - examples/ipc/localfortuneclient/client.cpp | 5 + examples/ipc/localfortuneclient/client.h | 9 + .../localfortuneclient/localfortuneclient.desktop | 11 + .../ipc/localfortuneclient/localfortuneclient.pro | 4 +- examples/ipc/localfortuneclient/main.cpp | 6 +- .../localfortuneserver/localfortuneserver.desktop | 11 + .../ipc/localfortuneserver/localfortuneserver.pro | 3 +- examples/ipc/localfortuneserver/main.cpp | 6 +- examples/ipc/localfortuneserver/server.cpp | 5 + examples/ipc/localfortuneserver/server.h | 8 + examples/ipc/sharedmemory/sharedmemory.desktop | 11 + examples/ipc/sharedmemory/sharedmemory.pro | 5 + examples/itemviews/addressbook/addressbook.desktop | 11 + examples/itemviews/addressbook/addressbook.pro | 2 + examples/itemviews/addressbook/main.cpp | 4 + .../basicsortfiltermodel.desktop | 11 + .../basicsortfiltermodel/basicsortfiltermodel.pro | 2 + examples/itemviews/basicsortfiltermodel/main.cpp | 4 + examples/itemviews/basicsortfiltermodel/window.cpp | 41 +- examples/itemviews/basicsortfiltermodel/window.h | 6 + examples/itemviews/chart/chart.desktop | 11 + examples/itemviews/chart/chart.pro | 2 + examples/itemviews/chart/main.cpp | 4 + .../coloreditorfactory/coloreditorfactory.desktop | 11 + .../coloreditorfactory/coloreditorfactory.pro | 4 + examples/itemviews/coloreditorfactory/main.cpp | 4 + .../combowidgetmapper/combowidgetmapper.desktop | 11 + .../combowidgetmapper/combowidgetmapper.pro | 3 + examples/itemviews/combowidgetmapper/main.cpp | 4 + .../customsortfiltermodel.desktop | 11 + .../customsortfiltermodel.pro | 1 + examples/itemviews/customsortfiltermodel/main.cpp | 4 + .../itemviews/customsortfiltermodel/window.cpp | 62 +- examples/itemviews/customsortfiltermodel/window.h | 6 + examples/itemviews/dirview/dirview.desktop | 11 + examples/itemviews/dirview/dirview.pro | 2 + examples/itemviews/dirview/main.cpp | 4 + .../editabletreemodel/editabletreemodel.desktop | 11 + .../editabletreemodel/editabletreemodel.pro | 2 + examples/itemviews/editabletreemodel/main.cpp | 4 + .../itemviews/editabletreemodel/mainwindow.cpp | 5 + examples/itemviews/fetchmore/fetchmore.desktop | 11 + examples/itemviews/fetchmore/fetchmore.pro | 2 + examples/itemviews/fetchmore/main.cpp | 4 + .../itemviews/frozencolumn/frozencolumn.desktop | 11 + examples/itemviews/frozencolumn/frozencolumn.pro | 3 + examples/itemviews/frozencolumn/main.cpp | 6 + examples/itemviews/itemviews.pro | 9 +- examples/itemviews/pixelator/main.cpp | 4 + examples/itemviews/pixelator/pixelator.desktop | 11 + examples/itemviews/pixelator/pixelator.pro | 2 + examples/itemviews/pixelator/pixeldelegate.cpp | 2 +- examples/itemviews/puzzle/main.cpp | 4 + examples/itemviews/puzzle/mainwindow.cpp | 20 +- examples/itemviews/puzzle/piecesmodel.cpp | 8 +- examples/itemviews/puzzle/piecesmodel.h | 4 +- examples/itemviews/puzzle/puzzle.desktop | 11 + examples/itemviews/puzzle/puzzle.pro | 2 + examples/itemviews/puzzle/puzzlewidget.cpp | 26 +- examples/itemviews/puzzle/puzzlewidget.h | 6 +- examples/itemviews/simpledommodel/main.cpp | 6 + .../simpledommodel/simpledommodel.desktop | 11 + .../itemviews/simpledommodel/simpledommodel.pro | 2 + examples/itemviews/simpletreemodel/main.cpp | 4 + .../simpletreemodel/simpletreemodel.desktop | 11 + .../itemviews/simpletreemodel/simpletreemodel.pro | 2 + examples/itemviews/simplewidgetmapper/main.cpp | 4 + .../simplewidgetmapper/simplewidgetmapper.desktop | 11 + .../simplewidgetmapper/simplewidgetmapper.pro | 2 + examples/itemviews/spinboxdelegate/main.cpp | 4 + .../spinboxdelegate/spinboxdelegate.desktop | 11 + .../itemviews/spinboxdelegate/spinboxdelegate.pro | 5 + examples/itemviews/stardelegate/main.cpp | 4 + .../itemviews/stardelegate/stardelegate.desktop | 11 + examples/itemviews/stardelegate/stardelegate.pro | 4 + examples/ja_JP/linguist/hellotr/hellotr.pro | 2 + examples/layouts/basiclayouts/basiclayouts.desktop | 11 + examples/layouts/basiclayouts/basiclayouts.pro | 5 + examples/layouts/basiclayouts/main.cpp | 8 +- examples/layouts/borderlayout/borderlayout.desktop | 11 + examples/layouts/borderlayout/borderlayout.pro | 2 + examples/layouts/borderlayout/main.cpp | 4 + examples/layouts/dynamiclayouts/dialog.cpp | 4 + examples/layouts/dynamiclayouts/dialog.h | 5 + .../layouts/dynamiclayouts/dynamiclayouts.desktop | 11 + examples/layouts/dynamiclayouts/dynamiclayouts.pro | 5 + examples/layouts/dynamiclayouts/main.cpp | 7 +- examples/layouts/flowlayout/flowlayout.desktop | 11 + examples/layouts/flowlayout/flowlayout.pro | 2 + examples/layouts/flowlayout/main.cpp | 4 + examples/layouts/flowlayout/window.cpp | 2 +- examples/layouts/layouts.pro | 1 - examples/linguist/arrowpad/arrowpad.desktop | 11 + examples/linguist/arrowpad/arrowpad.pro | 5 + examples/linguist/hellotr/hellotr.desktop | 11 + examples/linguist/hellotr/hellotr.pro | 5 + examples/linguist/linguist.pro | 1 - examples/linguist/trollprint/trollprint.desktop | 11 + examples/linguist/trollprint/trollprint.pro | 5 + examples/maemo5pkgrules.pri | 27 + .../mainwindows/application/application.desktop | 11 + examples/mainwindows/application/application.pro | 4 + examples/mainwindows/application/main.cpp | 4 + .../mainwindows/dockwidgets/dockwidgets.desktop | 11 + examples/mainwindows/dockwidgets/dockwidgets.pro | 5 + examples/mainwindows/mainwindows.pro | 6 - examples/mainwindows/mdi/main.cpp | 4 + examples/mainwindows/mdi/mdi.desktop | 11 + examples/mainwindows/mdi/mdi.pro | 4 + examples/mainwindows/menus/main.cpp | 4 + examples/mainwindows/menus/mainwindow.cpp | 6 + examples/mainwindows/menus/menus.desktop | 11 + examples/mainwindows/menus/menus.pro | 3 + examples/mainwindows/recentfiles/main.cpp | 4 + .../mainwindows/recentfiles/recentfiles.desktop | 11 + examples/mainwindows/recentfiles/recentfiles.pro | 3 + examples/mainwindows/sdi/main.cpp | 4 + examples/mainwindows/sdi/sdi.desktop | 11 + examples/mainwindows/sdi/sdi.pro | 4 + examples/multimedia/audiodevices/audiodevices.cpp | 4 +- .../multimedia/audiodevices/audiodevices.desktop | 11 + examples/multimedia/audiodevices/audiodevices.pro | 2 + examples/multimedia/audioinput/audioinput.desktop | 11 + examples/multimedia/audioinput/audioinput.pro | 3 + examples/multimedia/audioinput/main.cpp | 4 + .../multimedia/audiooutput/audiooutput.desktop | 11 + examples/multimedia/audiooutput/audiooutput.pro | 2 + examples/multimedia/audiooutput/main.cpp | 4 + .../videographicsitem/videographicsitem.desktop | 11 + .../videographicsitem/videographicsitem.pro | 3 + .../multimedia/videowidget/videowidget.desktop | 11 + examples/multimedia/videowidget/videowidget.pro | 3 + examples/network/bearercloud/bearercloud.desktop | 11 + examples/network/bearercloud/bearercloud.pro | 8 +- examples/network/bearermonitor/bearermonitor.cpp | 8 +- .../network/bearermonitor/bearermonitor.desktop | 11 + examples/network/bearermonitor/bearermonitor.h | 4 +- examples/network/bearermonitor/bearermonitor.pro | 9 +- .../blockingfortuneclient/blockingclient.cpp | 54 +- .../network/blockingfortuneclient/blockingclient.h | 10 +- .../blockingfortuneclient.desktop | 11 + .../blockingfortuneclient.pro | 9 +- examples/network/blockingfortuneclient/main.cpp | 6 +- .../broadcastreceiver/broadcastreceiver.desktop | 11 + .../broadcastreceiver/broadcastreceiver.pro | 6 +- examples/network/broadcastreceiver/main.cpp | 6 +- examples/network/broadcastreceiver/receiver.cpp | 18 +- examples/network/broadcastreceiver/receiver.h | 9 +- .../broadcastsender/broadcastsender.desktop | 11 + .../network/broadcastsender/broadcastsender.pro | 7 +- examples/network/broadcastsender/main.cpp | 6 +- examples/network/broadcastsender/sender.cpp | 3 +- examples/network/broadcastsender/sender.h | 4 +- examples/network/download/download.desktop | 11 + examples/network/download/download.pro | 5 +- .../downloadmanager/downloadmanager.desktop | 11 + .../network/downloadmanager/downloadmanager.pro | 12 +- .../network/fortuneclient/fortuneclient.desktop | 11 + examples/network/fortuneclient/fortuneclient.pro | 5 + .../network/fortuneserver/fortuneserver.desktop | 11 + examples/network/fortuneserver/fortuneserver.pro | 5 + .../network/googlesuggest/googlesuggest.desktop | 11 + examples/network/googlesuggest/googlesuggest.pro | 7 + examples/network/http/http.desktop | 11 + examples/network/http/http.pro | 7 +- examples/network/http/httpwindow.cpp | 25 +- examples/network/http/httpwindow.h | 10 + examples/network/http/main.cpp | 17 +- examples/network/loopback/dialog.cpp | 31 + examples/network/loopback/dialog.h | 7 + examples/network/loopback/loopback.desktop | 11 + examples/network/loopback/loopback.pro | 7 +- examples/network/loopback/main.cpp | 6 +- examples/network/network-chat/network-chat.desktop | 11 + examples/network/network-chat/network-chat.pro | 4 + examples/network/network.pro | 1 - examples/network/qftp/ftpwindow.cpp | 8 +- examples/network/qftp/qftp.desktop | 11 + examples/network/qftp/qftp.pro | 4 + .../network/securesocketclient/certificateinfo.cpp | 4 +- .../network/securesocketclient/certificateinfo.ui | 68 +- examples/network/securesocketclient/main.cpp | 4 + .../securesocketclient/securesocketclient.desktop | 11 + .../securesocketclient/securesocketclient.pro | 3 + examples/network/securesocketclient/sslclient.cpp | 7 +- examples/network/securesocketclient/sslclient.ui | 223 +++--- examples/network/securesocketclient/sslerrors.ui | 57 +- examples/network/threadedfortuneserver/dialog.cpp | 18 +- examples/network/threadedfortuneserver/dialog.h | 4 +- examples/network/threadedfortuneserver/main.cpp | 6 +- .../threadedfortuneserver.desktop | 11 + .../threadedfortuneserver.pro | 9 +- examples/network/torrent/torrent.desktop | 11 + examples/network/torrent/torrent.pro | 5 + examples/opengl/2dpainting/2dpainting.desktop | 11 + examples/opengl/2dpainting/2dpainting.pro | 4 + examples/opengl/cube/cube.desktop | 11 + examples/opengl/cube/cube.png | Bin 0 -> 30341 bytes examples/opengl/cube/cube.pro | 40 + examples/opengl/cube/fshader.glsl | 18 + examples/opengl/cube/geometryengine.cpp | 130 +++ examples/opengl/cube/geometryengine.h | 24 + examples/opengl/cube/main.cpp | 22 + examples/opengl/cube/mainwidget.cpp | 192 +++++ examples/opengl/cube/mainwidget.h | 53 ++ examples/opengl/cube/shaders.qrc | 6 + examples/opengl/cube/textures.qrc | 5 + examples/opengl/cube/vshader.glsl | 24 + .../framebufferobject/framebufferobject.desktop | 11 + .../opengl/framebufferobject/framebufferobject.pro | 5 +- .../framebufferobject2/framebufferobject2.desktop | 11 + .../framebufferobject2/framebufferobject2.pro | 5 + examples/opengl/grabber/grabber.desktop | 11 + examples/opengl/grabber/grabber.pro | 5 + examples/opengl/hellogl/hellogl.desktop | 11 + examples/opengl/hellogl/hellogl.pro | 5 + examples/opengl/hellogl_es/hellogl_es.desktop | 11 + examples/opengl/hellogl_es/hellogl_es.pro | 8 +- examples/opengl/hellogl_es2/hellogl_es2.desktop | 11 + examples/opengl/hellogl_es2/hellogl_es2.pro | 13 +- examples/opengl/opengl.pro | 4 +- examples/opengl/overpainting/overpainting.desktop | 11 + examples/opengl/overpainting/overpainting.pro | 5 + examples/opengl/pbuffers/pbuffers.desktop | 11 + examples/opengl/pbuffers/pbuffers.pro | 5 + examples/opengl/pbuffers2/pbuffers2.desktop | 11 + examples/opengl/pbuffers2/pbuffers2.pro | 6 +- .../opengl/samplebuffers/samplebuffers.desktop | 11 + examples/opengl/samplebuffers/samplebuffers.pro | 5 + examples/opengl/textures/textures.desktop | 11 + examples/opengl/textures/textures.pro | 4 + examples/openvg/openvg.desktop | 11 + examples/openvg/openvg.pro | 1 + .../painting/basicdrawing/basicdrawing.desktop | 11 + examples/painting/basicdrawing/basicdrawing.pro | 3 + examples/painting/basicdrawing/main.cpp | 4 + examples/painting/basicdrawing/window.cpp | 43 +- .../concentriccircles/concentriccircles.desktop | 11 + .../concentriccircles/concentriccircles.pro | 2 + examples/painting/concentriccircles/main.cpp | 4 + examples/painting/fontsampler/fontsampler.desktop | 11 + examples/painting/fontsampler/fontsampler.pro | 2 + examples/painting/fontsampler/main.cpp | 4 + examples/painting/fontsampler/mainwindow.cpp | 56 +- examples/painting/fontsampler/mainwindow.h | 4 + examples/painting/fontsampler/mainwindowbase.ui | 126 +-- .../painting/imagecomposition/imagecomposer.cpp | 10 + .../imagecomposition/imagecomposition.desktop | 11 + .../painting/imagecomposition/imagecomposition.pro | 2 + examples/painting/imagecomposition/main.cpp | 4 + examples/painting/painterpaths/main.cpp | 4 + .../painting/painterpaths/painterpaths.desktop | 11 + examples/painting/painterpaths/painterpaths.pro | 2 + examples/painting/painterpaths/window.cpp | 53 +- examples/painting/painterpaths/window.h | 4 +- examples/painting/painting.pro | 6 +- examples/painting/svggenerator/main.cpp | 4 + .../painting/svggenerator/svggenerator.desktop | 11 + examples/painting/svggenerator/svggenerator.pro | 2 + examples/painting/svggenerator/window.cpp | 4 + examples/painting/svgviewer/main.cpp | 4 + examples/painting/svgviewer/svgviewer.desktop | 11 + examples/painting/svgviewer/svgviewer.pro | 2 + examples/painting/transformations/main.cpp | 4 + .../transformations/transformations.desktop | 11 + .../painting/transformations/transformations.pro | 5 + examples/phonon/capabilities/capabilities.desktop | 11 + examples/phonon/capabilities/capabilities.pro | 11 +- examples/phonon/capabilities/main.cpp | 4 + examples/phonon/capabilities/window.cpp | 52 +- examples/phonon/capabilities/window.h | 1 - examples/phonon/phonon.pro | 1 - examples/phonon/qmusicplayer/main.cpp | 4 + examples/phonon/qmusicplayer/qmusicplayer.desktop | 11 + examples/phonon/qmusicplayer/qmusicplayer.pro | 11 +- examples/qt.png | Bin 0 -> 3142 bytes examples/qt.svg | 93 +++ .../qtconcurrent/imagescaling/imagescaling.desktop | 11 + .../qtconcurrent/imagescaling/imagescaling.pro | 3 + examples/qtconcurrent/imagescaling/main.cpp | 21 +- examples/qtconcurrent/map/main.cpp | 19 +- examples/qtconcurrent/map/map.desktop | 11 + examples/qtconcurrent/map/map.pro | 3 + examples/qtconcurrent/progressdialog/main.cpp | 17 +- .../progressdialog/progressdialog.desktop | 11 + .../qtconcurrent/progressdialog/progressdialog.pro | 4 +- examples/qtconcurrent/qtconcurrent.pro | 1 - examples/qtconcurrent/runfunction/main.cpp | 19 +- .../qtconcurrent/runfunction/runfunction.desktop | 11 + examples/qtconcurrent/runfunction/runfunction.pro | 4 +- examples/qtconcurrent/wordcount/main.cpp | 23 +- examples/qtconcurrent/wordcount/wordcount.desktop | 11 + examples/qtconcurrent/wordcount/wordcount.pro | 4 +- examples/qtestlib/qtestlib.pro | 1 - examples/qtestlib/tutorial1/tutorial1.desktop | 11 + examples/qtestlib/tutorial1/tutorial1.pro | 5 + examples/qtestlib/tutorial2/tutorial2.desktop | 11 + examples/qtestlib/tutorial2/tutorial2.pro | 5 + examples/qtestlib/tutorial3/tutorial3.desktop | 11 + examples/qtestlib/tutorial3/tutorial3.pro | 5 + examples/qtestlib/tutorial4/tutorial4.desktop | 11 + examples/qtestlib/tutorial4/tutorial4.pro | 5 + examples/qtestlib/tutorial5/tutorial5.desktop | 11 + examples/qtestlib/tutorial5/tutorial5.pro | 5 + examples/qws/dbscreen/dbscreen.desktop | 11 + examples/qws/dbscreen/dbscreen.pro | 4 + examples/qws/framebuffer/framebuffer.desktop | 11 + examples/qws/framebuffer/framebuffer.pro | 6 + .../qws/mousecalibration/mousecalibration.desktop | 11 + examples/qws/mousecalibration/mousecalibration.pro | 7 + .../qws/simpledecoration/simpledecoration.desktop | 11 + examples/qws/simpledecoration/simpledecoration.pro | 7 + examples/qws/svgalib/svgalib.desktop | 11 + examples/qws/svgalib/svgalib.pro | 6 + examples/richtext/calendar/calendar.desktop | 11 + examples/richtext/calendar/calendar.pro | 5 + examples/richtext/calendar/main.cpp | 6 + examples/richtext/calendar/mainwindow.cpp | 7 +- examples/richtext/orderform/detailsdialog.cpp | 30 + examples/richtext/orderform/main.cpp | 6 + examples/richtext/orderform/orderform.desktop | 11 + examples/richtext/orderform/orderform.pro | 2 + examples/richtext/richtext.pro | 1 - examples/richtext/syntaxhighlighter/main.cpp | 6 + .../syntaxhighlighter/syntaxhighlighter.desktop | 11 + .../syntaxhighlighter/syntaxhighlighter.pro | 2 + examples/richtext/textobject/main.cpp | 6 +- examples/richtext/textobject/resources.qrc | 5 + examples/richtext/textobject/textobject.desktop | 11 + examples/richtext/textobject/textobject.pro | 5 +- examples/richtext/textobject/window.cpp | 2 +- examples/script/calculator/calculator.desktop | 11 + examples/script/calculator/calculator.pro | 3 + examples/script/calculator/calculator.ui | 770 +++++++++--------- examples/script/context2d/context2d.desktop | 11 + examples/script/context2d/context2d.pro | 2 + examples/script/context2d/main.cpp | 4 + examples/script/context2d/qcontext2dcanvas.cpp | 4 +- examples/script/customclass/customclass.desktop | 11 + examples/script/customclass/customclass.pro | 3 + examples/script/defaultprototypes/code.js | 2 - .../defaultprototypes/defaultprototypes.desktop | 11 + .../script/defaultprototypes/defaultprototypes.pro | 2 + examples/script/defaultprototypes/main.cpp | 5 + examples/script/defaultprototypes/prototypes.cpp | 7 + examples/script/helloscript/helloscript.desktop | 11 + examples/script/helloscript/helloscript.pro | 2 + examples/script/helloscript/main.cpp | 4 + examples/script/marshal/marshal.desktop | 11 + examples/script/marshal/marshal.pro | 3 + examples/script/qscript/qscript.desktop | 11 + examples/script/qscript/qscript.pro | 3 + examples/script/qsdbg/qsdbg.desktop | 11 + examples/script/qsdbg/qsdbg.pro | 4 +- examples/script/qstetrix/qstetrix.desktop | 11 + examples/script/qstetrix/qstetrix.pro | 5 + examples/script/script.pro | 1 - examples/sql/cachedtable/cachedtable.desktop | 11 + examples/sql/cachedtable/cachedtable.pro | 2 + examples/sql/cachedtable/main.cpp | 6 +- examples/sql/cachedtable/tableeditor.cpp | 3 +- examples/sql/cachedtable/tableeditor.h | 2 +- examples/sql/drilldown/drilldown.desktop | 11 + examples/sql/drilldown/drilldown.pro | 3 + examples/sql/drilldown/informationwindow.cpp | 6 +- examples/sql/drilldown/main.cpp | 2 +- examples/sql/drilldown/view.cpp | 2 +- examples/sql/masterdetail/main.cpp | 4 + examples/sql/masterdetail/mainwindow.cpp | 4 + examples/sql/masterdetail/masterdetail.desktop | 11 + examples/sql/masterdetail/masterdetail.pro | 5 + examples/sql/querymodel/main.cpp | 27 +- examples/sql/querymodel/querymodel.desktop | 11 + examples/sql/querymodel/querymodel.pro | 2 + .../relationaltablemodel/relationaltablemodel.cpp | 4 + .../relationaltablemodel.desktop | 11 + .../relationaltablemodel/relationaltablemodel.pro | 2 + examples/sql/sql.pro | 1 - examples/sql/sqlwidgetmapper/main.cpp | 4 + .../sql/sqlwidgetmapper/sqlwidgetmapper.desktop | 11 + examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro | 3 + examples/sql/tablemodel/tablemodel.cpp | 18 +- examples/sql/tablemodel/tablemodel.desktop | 11 + examples/sql/tablemodel/tablemodel.pro | 2 + .../eventtransitions/eventtransitions.desktop | 11 + .../eventtransitions/eventtransitions.pro | 5 + examples/statemachine/eventtransitions/main.cpp | 11 +- examples/statemachine/factorial/factorial.desktop | 11 + examples/statemachine/factorial/factorial.pro | 5 + examples/statemachine/pingpong/pingpong.desktop | 11 + examples/statemachine/pingpong/pingpong.pro | 5 + examples/statemachine/rogue/main.cpp | 4 + examples/statemachine/rogue/movementtransition.h | 7 +- examples/statemachine/rogue/rogue.desktop | 11 + examples/statemachine/rogue/rogue.pro | 3 + examples/statemachine/rogue/window.cpp | 12 +- examples/statemachine/rogue/window.h | 5 + examples/statemachine/trafficlight/main.cpp | 9 + .../statemachine/trafficlight/trafficlight.desktop | 11 + .../statemachine/trafficlight/trafficlight.pro | 4 + examples/statemachine/twowaybutton/main.cpp | 6 + .../statemachine/twowaybutton/twowaybutton.desktop | 11 + .../statemachine/twowaybutton/twowaybutton.pro | 4 + examples/symbianpkgrules.pri | 1 - examples/threads/mandelbrot/main.cpp | 4 + examples/threads/mandelbrot/mandelbrot.desktop | 11 + examples/threads/mandelbrot/mandelbrot.pro | 2 + examples/threads/mandelbrot/mandelbrotwidget.cpp | 18 + examples/threads/mandelbrot/mandelbrotwidget.h | 30 +- examples/threads/queuedcustomtype/main.cpp | 4 + .../queuedcustomtype/queuedcustomtype.desktop | 11 + .../threads/queuedcustomtype/queuedcustomtype.pro | 10 + examples/threads/semaphores/semaphores.cpp | 81 +- examples/threads/semaphores/semaphores.desktop | 11 + examples/threads/semaphores/semaphores.pro | 6 +- examples/threads/threads.pro | 1 - examples/threads/waitconditions/waitconditions.cpp | 132 +++- .../threads/waitconditions/waitconditions.desktop | 11 + examples/threads/waitconditions/waitconditions.pro | 5 +- examples/tools/codecs/codecs.desktop | 11 + examples/tools/codecs/codecs.pro | 5 + examples/tools/completer/completer.desktop | 11 + examples/tools/completer/completer.pro | 5 + .../tools/contiguouscache/contiguouscache.desktop | 11 + examples/tools/contiguouscache/contiguouscache.pro | 7 + .../tools/customcompleter/customcompleter.desktop | 11 + examples/tools/customcompleter/customcompleter.pro | 5 + examples/tools/customtype/customtype.desktop | 11 + examples/tools/customtype/customtype.pro | 13 + .../customtypesending/customtypesending.desktop | 11 + .../tools/customtypesending/customtypesending.pro | 13 + examples/tools/echoplugin/echoplugin.pro | 1 - .../tools/echoplugin/echowindow/echowindow.desktop | 11 + .../tools/echoplugin/echowindow/echowindow.pro | 5 + examples/tools/echoplugin/plugin/plugin.desktop | 11 + examples/tools/echoplugin/plugin/plugin.pro | 10 +- examples/tools/i18n/i18n.desktop | 11 + examples/tools/i18n/i18n.pro | 5 + examples/tools/inputpanel/inputpanel.desktop | 11 + examples/tools/inputpanel/inputpanel.pro | 5 + examples/tools/plugandpaint/plugandpaint.desktop | 11 + examples/tools/plugandpaint/plugandpaint.pro | 5 + .../plugandpaintplugins/basictools/basictools.pro | 1 + .../extrafilters/extrafilters.pro | 1 + .../plugandpaintplugins/plugandpaintplugins.pro | 2 + examples/tools/regexp/regexp.desktop | 11 + examples/tools/regexp/regexp.pro | 5 + .../tools/settingseditor/settingseditor.desktop | 11 + examples/tools/settingseditor/settingseditor.pro | 5 + examples/tools/styleplugin/plugin/plugin.pro | 1 + examples/tools/styleplugin/styleplugin.pro | 2 + .../tools/styleplugin/stylewindow/stylewindow.pro | 1 + examples/tools/tools.pro | 1 - .../treemodelcompleter/treemodelcompleter.desktop | 11 + .../treemodelcompleter/treemodelcompleter.pro | 5 + examples/tools/undoframework/undoframework.desktop | 11 + examples/tools/undoframework/undoframework.pro | 5 + examples/touch/dials/dials.desktop | 11 + examples/touch/dials/dials.pro | 7 + examples/touch/fingerpaint/fingerpaint.desktop | 11 + examples/touch/fingerpaint/fingerpaint.pro | 7 + examples/touch/knobs/knobs.desktop | 11 + examples/touch/knobs/knobs.pro | 7 + examples/touch/pinchzoom/pinchzoom.desktop | 11 + examples/touch/pinchzoom/pinchzoom.pro | 7 + .../tutorials/addressbook-fr/addressbook-fr.pro | 1 + .../tutorials/addressbook-fr/part1/part1.desktop | 11 + examples/tutorials/addressbook-fr/part1/part1.pro | 7 + .../tutorials/addressbook-fr/part2/part2.desktop | 11 + examples/tutorials/addressbook-fr/part2/part2.pro | 7 + .../tutorials/addressbook-fr/part3/part3.desktop | 11 + examples/tutorials/addressbook-fr/part3/part3.pro | 7 + .../tutorials/addressbook-fr/part4/part4.desktop | 11 + examples/tutorials/addressbook-fr/part4/part4.pro | 7 + .../tutorials/addressbook-fr/part5/part5.desktop | 11 + examples/tutorials/addressbook-fr/part5/part5.pro | 7 + .../tutorials/addressbook-fr/part6/part6.desktop | 11 + examples/tutorials/addressbook-fr/part6/part6.pro | 7 + .../tutorials/addressbook-fr/part7/part7.desktop | 11 + examples/tutorials/addressbook-fr/part7/part7.pro | 7 + examples/tutorials/addressbook/addressbook.pro | 1 - examples/tutorials/addressbook/part1/part1.desktop | 11 + examples/tutorials/addressbook/part1/part1.pro | 5 + examples/tutorials/addressbook/part2/part2.desktop | 11 + examples/tutorials/addressbook/part2/part2.pro | 5 + examples/tutorials/addressbook/part3/part3.desktop | 11 + examples/tutorials/addressbook/part3/part3.pro | 5 + examples/tutorials/addressbook/part4/part4.desktop | 11 + examples/tutorials/addressbook/part4/part4.pro | 5 + examples/tutorials/addressbook/part5/part5.desktop | 11 + examples/tutorials/addressbook/part5/part5.pro | 5 + examples/tutorials/addressbook/part6/part6.desktop | 11 + examples/tutorials/addressbook/part6/part6.pro | 5 + examples/tutorials/addressbook/part7/part7.desktop | 11 + examples/tutorials/addressbook/part7/part7.pro | 5 + .../gsQml/parts/part5/filedialog/dialogPlugin.cpp | 2 +- .../gsQml/parts/part5/filedialog/directory.cpp | 2 +- .../gsQml/parts/part5/filedialog/file.cpp | 2 +- .../gsQml/parts/part5/filedialog/file.h | 2 +- .../modelview/1_readonly/1_readonly.desktop | 11 + .../tutorials/modelview/1_readonly/1_readonly.pro | 5 + .../modelview/2_formatting/2_formatting.desktop | 11 + .../modelview/2_formatting/2_formatting.pro | 5 + .../3_changingmodel/3_changingmodel.desktop | 11 + .../modelview/3_changingmodel/3_changingmodel.pro | 5 + .../modelview/4_headers/4_headers.desktop | 11 + .../tutorials/modelview/4_headers/4_headers.pro | 5 + examples/tutorials/modelview/5_edit/5_edit.desktop | 11 + examples/tutorials/modelview/5_edit/5_edit.pro | 5 + .../modelview/6_treeview/6_treeview.desktop | 11 + .../tutorials/modelview/6_treeview/6_treeview.pro | 5 + .../modelview/7_selections/7_selections.desktop | 11 + .../modelview/7_selections/7_selections.pro | 5 + examples/tutorials/modelview/modelview.pro | 1 - examples/tutorials/tutorials.pro | 1 - .../widgets/childwidget/childwidget.desktop | 11 + .../tutorials/widgets/childwidget/childwidget.pro | 7 + .../widgets/nestedlayouts/nestedlayouts.desktop | 11 + .../widgets/nestedlayouts/nestedlayouts.pro | 7 + .../tutorials/widgets/toplevel/toplevel.desktop | 11 + examples/tutorials/widgets/toplevel/toplevel.pro | 7 + .../widgets/windowlayout/windowlayout.desktop | 11 + .../widgets/windowlayout/windowlayout.pro | 7 + examples/uitools/multipleinheritance/main.cpp | 4 + .../multipleinheritance.desktop | 11 + .../multipleinheritance/multipleinheritance.pro | 2 + examples/uitools/textfinder/textfinder.desktop | 11 + examples/uitools/textfinder/textfinder.pro | 4 + examples/uitools/uitools.pro | 1 - examples/webkit/domtraversal/domtraversal.desktop | 11 + examples/webkit/domtraversal/domtraversal.pro | 8 +- examples/webkit/domtraversal/main.cpp | 6 +- examples/webkit/domtraversal/window.h | 6 +- examples/webkit/domtraversal/window_mobiles.ui | 90 +++ examples/webkit/fancybrowser/fancybrowser.desktop | 11 + examples/webkit/fancybrowser/fancybrowser.pro | 4 +- examples/webkit/fancybrowser/main.cpp | 6 +- examples/webkit/formextractor/formextractor.cpp | 5 + .../webkit/formextractor/formextractor.desktop | 11 + examples/webkit/formextractor/formextractor.h | 6 +- examples/webkit/formextractor/formextractor.pro | 5 +- .../webkit/formextractor/formextractor_mobiles.ui | 139 ++++ examples/webkit/framecapture/framecapture.desktop | 11 + examples/webkit/framecapture/framecapture.pro | 10 + examples/webkit/googlechat/googlechat.desktop | 11 + examples/webkit/googlechat/googlechat.pro | 6 + examples/webkit/previewer/main.cpp | 6 +- examples/webkit/previewer/previewer.cpp | 5 + examples/webkit/previewer/previewer.desktop | 11 + examples/webkit/previewer/previewer.h | 6 +- examples/webkit/previewer/previewer.pro | 5 +- examples/webkit/previewer/previewer_mobiles.ui | 96 +++ examples/webkit/simpleselector/main.cpp | 6 +- .../webkit/simpleselector/simpleselector.desktop | 11 + examples/webkit/simpleselector/simpleselector.pro | 3 + examples/webkit/webkit.pro | 1 - examples/widgets/analogclock/analogclock.desktop | 11 + examples/widgets/analogclock/analogclock.pro | 2 + examples/widgets/analogclock/main.cpp | 4 + .../applicationicon/applicationicon.desktop | 11 + .../widgets/applicationicon/applicationicon.png | Bin 0 -> 4023 bytes .../widgets/applicationicon/applicationicon.pro | 30 + .../widgets/applicationicon/applicationicon.svg | 22 + examples/widgets/applicationicon/main.cpp | 14 + examples/widgets/calculator/calculator.cpp | 7 +- examples/widgets/calculator/calculator.desktop | 11 + examples/widgets/calculator/calculator.h | 4 +- examples/widgets/calculator/calculator.pro | 2 + examples/widgets/calculator/main.cpp | 4 + examples/widgets/calculator/releasenotes.txt | 4 + .../widgets/calendarwidget/calendarwidget.desktop | 11 + examples/widgets/calendarwidget/calendarwidget.pro | 5 + examples/widgets/charactermap/charactermap.desktop | 11 + examples/widgets/charactermap/charactermap.pro | 5 + examples/widgets/codeeditor/codeeditor.desktop | 11 + examples/widgets/codeeditor/codeeditor.pro | 5 + examples/widgets/codeeditor/main.cpp | 4 + examples/widgets/digitalclock/digitalclock.desktop | 11 + examples/widgets/digitalclock/digitalclock.pro | 2 + examples/widgets/digitalclock/main.cpp | 4 + examples/widgets/elidedlabel/elidedlabel.cpp | 71 ++ examples/widgets/elidedlabel/elidedlabel.desktop | 11 + examples/widgets/elidedlabel/elidedlabel.h | 36 + examples/widgets/elidedlabel/elidedlabel.pro | 31 + examples/widgets/elidedlabel/main.cpp | 13 + examples/widgets/elidedlabel/testwidget.cpp | 124 +++ examples/widgets/elidedlabel/testwidget.h | 36 + examples/widgets/groupbox/groupbox.desktop | 11 + examples/widgets/groupbox/groupbox.pro | 5 + examples/widgets/groupbox/main.cpp | 4 + examples/widgets/icons/icons.desktop | 11 + examples/widgets/icons/icons.pro | 5 + examples/widgets/icons/main.cpp | 4 + examples/widgets/imageviewer/imageviewer.desktop | 11 + examples/widgets/imageviewer/imageviewer.pro | 8 + examples/widgets/imageviewer/main.cpp | 4 + examples/widgets/lineedits/lineedits.desktop | 11 + examples/widgets/lineedits/lineedits.pro | 5 + examples/widgets/lineedits/main.cpp | 4 + examples/widgets/maemovibration/buttonwidget.cpp | 26 + examples/widgets/maemovibration/buttonwidget.h | 24 + .../maemovibration/data/48x48/maemovibration.png | Bin 0 -> 2406 bytes .../maemovibration/data/64x64/maemovibration.png | Bin 0 -> 2989 bytes .../maemovibration/data/maemovibration.desktop | 12 + .../maemovibration/data/maemovibration.service | 3 + examples/widgets/maemovibration/maemovibration.pro | 52 ++ examples/widgets/maemovibration/main.cpp | 44 ++ examples/widgets/maemovibration/mcevibrator.cpp | 79 ++ examples/widgets/maemovibration/mcevibrator.h | 31 + examples/widgets/movie/main.cpp | 5 + examples/widgets/movie/movie.desktop | 11 + examples/widgets/movie/movie.pro | 5 + examples/widgets/orientation/image_a.png | Bin 0 -> 1075 bytes examples/widgets/orientation/image_b.png | Bin 0 -> 1020 bytes examples/widgets/orientation/image_c.png | Bin 0 -> 1163 bytes examples/widgets/orientation/images.qrc | 7 + examples/widgets/orientation/landscape.ui | 114 +++ examples/widgets/orientation/main.cpp | 15 + examples/widgets/orientation/mainwindow.cpp | 75 ++ examples/widgets/orientation/mainwindow.h | 33 + examples/widgets/orientation/orientation.desktop | 11 + examples/widgets/orientation/orientation.pro | 30 + examples/widgets/orientation/portrait.ui | 61 ++ examples/widgets/scribble/main.cpp | 4 + examples/widgets/scribble/scribble.desktop | 11 + examples/widgets/scribble/scribble.pro | 2 + examples/widgets/shapedclock/main.cpp | 4 + examples/widgets/shapedclock/shapedclock.desktop | 11 + examples/widgets/shapedclock/shapedclock.pro | 4 + examples/widgets/sliders/main.cpp | 4 + examples/widgets/sliders/sliders.desktop | 11 + examples/widgets/sliders/sliders.pro | 5 + examples/widgets/softkeys/softkeys.desktop | 11 + examples/widgets/softkeys/softkeys.pro | 2 + examples/widgets/spinboxes/main.cpp | 4 + examples/widgets/spinboxes/spinboxes.desktop | 11 + examples/widgets/spinboxes/spinboxes.pro | 5 + examples/widgets/styles/styles.desktop | 11 + examples/widgets/styles/styles.pro | 5 + examples/widgets/stylesheet/main.cpp | 4 + examples/widgets/stylesheet/stylesheet.desktop | 11 + examples/widgets/stylesheet/stylesheet.pro | 5 + examples/widgets/symbianvibration/main.cpp | 14 + examples/widgets/symbianvibration/mainwindow.cpp | 23 + examples/widgets/symbianvibration/mainwindow.h | 23 + .../widgets/symbianvibration/symbianvibration.pro | 39 + .../widgets/symbianvibration/vibrationsurface.cpp | 117 +++ .../widgets/symbianvibration/vibrationsurface.h | 31 + examples/widgets/symbianvibration/xqvibra.cpp | 170 ++++ examples/widgets/symbianvibration/xqvibra.h | 61 ++ examples/widgets/symbianvibration/xqvibra_p.cpp | 131 ++++ examples/widgets/symbianvibration/xqvibra_p.h | 39 + examples/widgets/tablet/main.cpp | 7 +- examples/widgets/tablet/tablet.desktop | 11 + examples/widgets/tablet/tablet.pro | 5 + examples/widgets/tetrix/main.cpp | 4 + examples/widgets/tetrix/tetrix.desktop | 11 + examples/widgets/tetrix/tetrix.pro | 2 + examples/widgets/tooltips/main.cpp | 4 + examples/widgets/tooltips/tooltips.desktop | 11 + examples/widgets/tooltips/tooltips.pro | 2 + examples/widgets/validators/main.cpp | 4 + examples/widgets/validators/validators.desktop | 11 + examples/widgets/validators/validators.pro | 5 + examples/widgets/widgets.pro | 9 +- examples/widgets/wiggly/main.cpp | 4 + examples/widgets/wiggly/wiggly.desktop | 11 + examples/widgets/wiggly/wiggly.pro | 2 + examples/widgets/windowflags/main.cpp | 4 + examples/widgets/windowflags/windowflags.desktop | 11 + examples/widgets/windowflags/windowflags.pro | 5 + examples/xml/dombookmarks/dombookmarks.desktop | 11 + examples/xml/dombookmarks/dombookmarks.pro | 15 +- examples/xml/dombookmarks/main.cpp | 5 + examples/xml/dombookmarks/mainwindow.cpp | 18 + examples/xml/htmlinfo/htmlinfo.desktop | 11 + examples/xml/htmlinfo/htmlinfo.pro | 11 +- examples/xml/htmlinfo/main.cpp | 5 +- examples/xml/htmlinfo/resources.qrc | 11 + examples/xml/rsslisting/main.cpp | 4 + examples/xml/rsslisting/rsslisting.cpp | 20 + examples/xml/rsslisting/rsslisting.desktop | 11 + examples/xml/rsslisting/rsslisting.h | 15 + examples/xml/rsslisting/rsslisting.pro | 13 +- examples/xml/saxbookmarks/saxbookmarks.desktop | 11 + examples/xml/saxbookmarks/saxbookmarks.pro | 2 + examples/xml/streambookmarks/main.cpp | 3 + examples/xml/streambookmarks/mainwindow.cpp | 18 + .../xml/streambookmarks/streambookmarks.desktop | 11 + examples/xml/streambookmarks/streambookmarks.pro | 9 +- examples/xml/xml.pro | 1 - examples/xml/xmlstreamlint/xmlstreamlint.desktop | 11 + examples/xml/xmlstreamlint/xmlstreamlint.pro | 4 + examples/xmlpatterns/filetree/filetree.desktop | 11 + examples/xmlpatterns/filetree/filetree.pro | 5 + .../qobjectxmlmodel/qobjectxmlmodel.desktop | 11 + .../qobjectxmlmodel/qobjectxmlmodel.pro | 5 + .../recipes/forms/querywidget_mobiles.ui | 87 +++ examples/xmlpatterns/recipes/main.cpp | 4 + examples/xmlpatterns/recipes/querymainwindow.h | 6 +- examples/xmlpatterns/recipes/recipes.desktop | 11 + examples/xmlpatterns/recipes/recipes.pro | 5 +- examples/xmlpatterns/schema/main.cpp | 4 + examples/xmlpatterns/schema/mainwindow.h | 6 +- examples/xmlpatterns/schema/schema.desktop | 11 + examples/xmlpatterns/schema/schema.pro | 4 +- examples/xmlpatterns/schema/schema_mobiles.ui | 130 +++ .../xmlpatterns/trafficinfo/trafficinfo.desktop | 11 + examples/xmlpatterns/trafficinfo/trafficinfo.pro | 5 + examples/xmlpatterns/xmlpatterns.pro | 1 - .../xquery/globalVariables/globalVariables.desktop | 11 + .../xquery/globalVariables/globalVariables.pro | 1 - examples/xmlpatterns/xquery/xquery.pro | 2 + qmake/generators/symbian/symbiancommon.h | 1 + .../debugger/qdeclarativedebugservice_p.h | 2 +- src/declarative/debugger/qpacketprotocol_p.h | 4 +- src/gui/itemviews/qdatawidgetmapper.cpp | 2 +- src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 13 + src/gui/kernel/qwidget.cpp | 2 +- src/gui/styles/qs60style_feedbackinterface_p.h | 50 ++ src/plugins/s60/feedback/feedback.pro | 18 + src/plugins/s60/feedback/qtactileFeedback.h | 54 ++ src/plugins/s60/feedback/qtactileFeedback_s60.cpp | 83 ++ .../data/flickable-horizontal.4.png | Bin 1450 -> 1454 bytes .../qdeclarativepathview/data/test-pathview.6.png | Bin 1188 -> 1189 bytes .../data/usingRepeater.0.png | Bin 1747 -> 1199 bytes .../content/center.png~HEAD | Bin 0 -> 765 bytes .../content/clock.png~HEAD | Bin 0 -> 20653 bytes .../content/hour.png~HEAD | Bin 0 -> 625 bytes .../content/minute.png~HEAD | Bin 0 -> 625 bytes .../qdeclarativespringanimation/data/follow.0.png | Bin 950 -> 941 bytes .../qdeclarativespringanimation/data/follow.1.png | Bin 983 -> 975 bytes .../qdeclarativespringanimation/data/follow.2.png | Bin 1243 -> 1235 bytes .../qdeclarativespringanimation/data/follow.3.png | Bin 1235 -> 1225 bytes .../qdeclarativespringanimation/data/follow.4.png | Bin 1253 -> 1247 bytes .../qdeclarativespringanimation/data/follow.5.png | Bin 1249 -> 1243 bytes .../qdeclarativespringanimation/data/follow.6.png | Bin 1241 -> 1234 bytes .../qdeclarativespringanimation/data/follow.7.png | Bin 1251 -> 1242 bytes .../align/data-MAC/multilineAlign.0.png | Bin 801 -> 2388 bytes .../align/data-X11/multilineAlign.0.png | Bin 791 -> 762 bytes .../baseline/data-X11/parentanchor.0.png | Bin 1313 -> 1313 bytes .../qdeclarativetext/data-MAC/qtbug_14865.0.png | Bin 322 -> 1640 bytes .../qdeclarativetext/data-MAC/qtbug_14865.1.png | Bin 322 -> 625 bytes .../qdeclarativetext/data-X11/qtbug_14865.0.png | Bin 465 -> 303 bytes .../qdeclarativetext/data-X11/qtbug_14865.1.png | Bin 465 -> 303 bytes .../qdeclarativetext/elide/data-X11/elide.1.png | Bin 581 -> 483 bytes .../qdeclarativetext/elide/data-X11/elide2.0.png | Bin 1187 -> 1189 bytes .../qdeclarativetext/elide/data-X11/elide2.1.png | Bin 1066 -> 1068 bytes .../elide/data-X11/multilength.1.png | Bin 967 -> 814 bytes .../elide/data-X11/multilength.2.png | Bin 962 -> 809 bytes .../elide/data-X11/multilength.3.png | Bin 678 -> 527 bytes .../elide/data-X11/multilength.4.png | Bin 676 -> 526 bytes .../elide/data-X11/multilength.5.png | Bin 542 -> 399 bytes .../font/data-MAC/plaintext2.0.png | Bin 1563 -> 3481 bytes .../font/data-MAC/plaintext3.0.png | Bin 6348 -> 53503 bytes .../qdeclarativetext/font/data-X11/plaintext.0.png | Bin 13194 -> 13140 bytes .../font/data-X11/plaintext2.0.png | Bin 1510 -> 1503 bytes .../qdeclarativetext/font/data-X11/richtext.0.png | Bin 9415 -> 9297 bytes .../qdeclarativetext/font/data-X11/richtext2.0.png | Bin 10671 -> 10626 bytes .../data-MAC/usingMultilineEdit.0.png | Bin 1362 -> 5123 bytes .../data-MAC/usingMultilineEdit.1.png | Bin 1377 -> 5500 bytes .../data-MAC/usingMultilineEdit.10.png | Bin 2037 -> 8641 bytes .../data-MAC/usingMultilineEdit.11.png | Bin 2037 -> 8641 bytes .../data-MAC/usingMultilineEdit.2.png | Bin 1461 -> 6163 bytes .../data-MAC/usingMultilineEdit.3.png | Bin 1577 -> 6785 bytes .../data-MAC/usingMultilineEdit.4.png | Bin 1704 -> 6943 bytes .../data-MAC/usingMultilineEdit.5.png | Bin 1778 -> 7043 bytes .../data-MAC/usingMultilineEdit.6.png | Bin 1797 -> 7428 bytes .../data-MAC/usingMultilineEdit.7.png | Bin 1859 -> 6860 bytes .../data-MAC/usingMultilineEdit.8.png | Bin 1835 -> 8659 bytes .../data-MAC/usingMultilineEdit.9.png | Bin 2028 -> 8641 bytes .../qdeclarativetextedit/data-MAC/wrap.0.png | Bin 3756 -> 11626 bytes .../qdeclarativetextedit/data-MAC/wrap.1.png | Bin 3891 -> 11869 bytes .../qdeclarativetextedit/data-MAC/wrap.2.png | Bin 3964 -> 12264 bytes .../qdeclarativetextedit/data-MAC/wrap.3.png | Bin 4054 -> 12607 bytes .../qdeclarativetextedit/data-MAC/wrap.4.png | Bin 4132 -> 13243 bytes .../qdeclarativetextedit/data-MAC/wrap.5.png | Bin 4234 -> 13260 bytes .../qdeclarativetextedit/data-MAC/wrap.6.png | Bin 4238 -> 13260 bytes .../qdeclarativetextedit/data-X11/qt-669.0.png | Bin 855 -> 688 bytes .../qdeclarativetextedit/data-X11/qt-669.1.png | Bin 863 -> 693 bytes .../qdeclarativetextedit/data-X11/qt-669.2.png | Bin 865 -> 695 bytes .../qdeclarativetextedit/data-X11/qt-669.3.png | Bin 862 -> 694 bytes .../qdeclarativetextedit/data-X11/qt-669.4.png | Bin 855 -> 688 bytes .../data-X11/usingMultilineEdit.10.png | Bin 2032 -> 2020 bytes .../data-X11/usingMultilineEdit.11.png | Bin 2032 -> 2020 bytes .../data-X11/usingMultilineEdit.12.png | Bin 2032 -> 2020 bytes .../data-X11/usingMultilineEdit.7.png | Bin 1843 -> 1836 bytes .../data-X11/usingMultilineEdit.9.png | Bin 2024 -> 2008 bytes .../qdeclarativetextedit/data-X11/wrap.7.png | Bin 3930 -> 3943 bytes .../qdeclarativetextinput/data-MAC/echoMode.0.png | Bin 256 -> 703 bytes .../qdeclarativetextinput/data-MAC/echoMode.1.png | Bin 343 -> 1360 bytes .../qdeclarativetextinput/data-MAC/echoMode.2.png | Bin 461 -> 2031 bytes .../data-X11/usingLineEdit.11.png | Bin 1468 -> 1455 bytes tools/qdoc3/ditaxmlgenerator.cpp | 24 +- tools/qdoc3/doc/corefeatures.qdoc | 35 + tools/qdoc3/doc/qdoc-manual.qdoc | 206 +++-- tools/qdoc3/helpprojectwriter.cpp | 1 + tools/qdoc3/htmlgenerator.cpp | 2 + tools/qdoc3/test/qt-html-default-styles.qdocconf | 6 +- tools/qdoc3/test/qt-html-templates.qdocconf | 505 ++++++------ translations/qt_de.ts | 34 + 2144 files changed, 62506 insertions(+), 3897 deletions(-) create mode 100644 doc/src/examples/applicationicon.qdoc create mode 100644 doc/src/examples/cube.qdoc create mode 100644 doc/src/examples/elidedlabel.qdoc create mode 100644 doc/src/examples/maemovibration.qdoc create mode 100644 doc/src/examples/orientation.qdoc create mode 100644 doc/src/examples/symbianvibration.qdoc create mode 100644 doc/src/images/appicon_packagecontents.png create mode 100644 doc/src/images/appicon_screenshot.png create mode 100644 doc/src/images/cube.png create mode 100644 doc/src/images/cube_faces.png create mode 100644 doc/src/images/elidedlabel-example.png create mode 100644 doc/src/images/maemovibration-example.png create mode 100644 doc/src/images/orientation-landscape-ui.png create mode 100644 doc/src/images/orientation-landscape.png create mode 100644 doc/src/images/orientation-portrait-ui.png create mode 100644 doc/src/images/orientation-portrait.png create mode 100644 doc/src/images/qml-listview-snippet.png create mode 100644 doc/src/images/symbianvibration-example.png create mode 100644 doc/src/snippets/declarative/grid/grid-items.qml create mode 100644 doc/src/snippets/declarative/grid/grid-no-spacing.qml create mode 100644 doc/src/snippets/declarative/grid/grid-spacing.qml create mode 100644 doc/src/snippets/declarative/listview/listview-snippet.qml create mode 100644 doc/src/snippets/declarative/qml-intro/images/qt-logo.svg create mode 100644 examples/animation/animatedtiles/animatedtiles.desktop create mode 100644 examples/animation/appchooser/appchooser.desktop create mode 100644 examples/animation/easing/easing.desktop create mode 100644 examples/animation/moveblocks/moveblocks.desktop create mode 100644 examples/animation/states/states.desktop create mode 100644 examples/animation/stickman/rectbutton.cpp create mode 100644 examples/animation/stickman/rectbutton.h create mode 100644 examples/animation/stickman/stickman.desktop create mode 100644 examples/dbus/complexpingpong/complexping.desktop create mode 100644 examples/dbus/complexpingpong/complexpong.desktop create mode 100644 examples/dbus/dbus-chat/dbus-chat.desktop create mode 100644 examples/dbus/listnames/listnames.desktop create mode 100644 examples/dbus/pingpong/ping.desktop create mode 100644 examples/dbus/pingpong/pong.desktop create mode 100644 examples/dbus/remotecontrolledcar/car/car.desktop create mode 100644 examples/dbus/remotecontrolledcar/controller/controller.desktop delete mode 100644 examples/declarative/animation/animation.qmlproject delete mode 100644 examples/declarative/animation/basics/basics.qmlproject create mode 100644 examples/declarative/animation/basics/color-animation/coloranimation.desktop create mode 100644 examples/declarative/animation/basics/color-animation/coloranimation.png create mode 100644 examples/declarative/animation/basics/color-animation/coloranimation.pro create mode 100644 examples/declarative/animation/basics/color-animation/coloranimation.svg create mode 100644 examples/declarative/animation/basics/color-animation/main.cpp create mode 100644 examples/declarative/animation/basics/color-animation/qml/basics.qmlproject create mode 100644 examples/declarative/animation/basics/color-animation/qml/color-animation.qml create mode 100644 examples/declarative/animation/basics/color-animation/qml/images/face-smile.png create mode 100644 examples/declarative/animation/basics/color-animation/qml/images/moon.png create mode 100644 examples/declarative/animation/basics/color-animation/qml/images/shadow.png create mode 100644 examples/declarative/animation/basics/color-animation/qml/images/star.png create mode 100644 examples/declarative/animation/basics/color-animation/qml/images/sun.png create mode 100644 examples/declarative/animation/basics/color-animation/qml/property-animation.qml create mode 100644 examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/animation/basics/images/face-smile.png delete mode 100644 examples/declarative/animation/basics/images/moon.png delete mode 100644 examples/declarative/animation/basics/images/shadow.png delete mode 100644 examples/declarative/animation/basics/images/star.png delete mode 100644 examples/declarative/animation/basics/images/sun.png create mode 100644 examples/declarative/animation/basics/property-animation/main.cpp create mode 100644 examples/declarative/animation/basics/property-animation/propertyanimation.desktop create mode 100644 examples/declarative/animation/basics/property-animation/propertyanimation.png create mode 100644 examples/declarative/animation/basics/property-animation/propertyanimation.pro create mode 100644 examples/declarative/animation/basics/property-animation/propertyanimation.svg create mode 100644 examples/declarative/animation/basics/property-animation/qml/basics.qmlproject create mode 100644 examples/declarative/animation/basics/property-animation/qml/color-animation.qml create mode 100644 examples/declarative/animation/basics/property-animation/qml/images/face-smile.png create mode 100644 examples/declarative/animation/basics/property-animation/qml/images/moon.png create mode 100644 examples/declarative/animation/basics/property-animation/qml/images/shadow.png create mode 100644 examples/declarative/animation/basics/property-animation/qml/images/star.png create mode 100644 examples/declarative/animation/basics/property-animation/qml/images/sun.png create mode 100644 examples/declarative/animation/basics/property-animation/qml/property-animation.qml create mode 100644 examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/rules create mode 100644 examples/declarative/animation/behaviors/behavior-example/behaviorexample.desktop create mode 100644 examples/declarative/animation/behaviors/behavior-example/behaviorexample.png create mode 100644 examples/declarative/animation/behaviors/behavior-example/behaviorexample.pro create mode 100644 examples/declarative/animation/behaviors/behavior-example/behaviorexample.svg create mode 100644 examples/declarative/animation/behaviors/behavior-example/main.cpp create mode 100644 examples/declarative/animation/behaviors/behavior-example/qml/SideRect.qml create mode 100644 examples/declarative/animation/behaviors/behavior-example/qml/behavior-example.qml create mode 100644 examples/declarative/animation/behaviors/behavior-example/qml/behaviors.qmlproject create mode 100644 examples/declarative/animation/behaviors/behavior-example/qml/wigglytext.qml create mode 100644 examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/animation/behaviors/behaviors.qmlproject delete mode 100644 examples/declarative/animation/easing/content/quit.png create mode 100644 examples/declarative/animation/easing/easing.desktop create mode 100644 examples/declarative/animation/easing/easing.png create mode 100644 examples/declarative/animation/easing/easing.pro delete mode 100644 examples/declarative/animation/easing/easing.qmlproject create mode 100644 examples/declarative/animation/easing/easing.svg create mode 100644 examples/declarative/animation/easing/main.cpp create mode 100644 examples/declarative/animation/easing/qml/content/QuitButton.qml create mode 100644 examples/declarative/animation/easing/qml/content/quit.png create mode 100644 examples/declarative/animation/easing/qml/easing.qml create mode 100644 examples/declarative/animation/easing/qml/easing.qmlproject create mode 100644 examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/animation/states/main.cpp create mode 100644 examples/declarative/animation/states/qml/qt-logo.png create mode 100644 examples/declarative/animation/states/qml/states.qml create mode 100644 examples/declarative/animation/states/qml/states.qmlproject create mode 100644 examples/declarative/animation/states/qml/transitions.qml create mode 100644 examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/animation/states/qt-logo.png create mode 100644 examples/declarative/animation/states/states.desktop create mode 100644 examples/declarative/animation/states/states.png create mode 100644 examples/declarative/animation/states/states.pro delete mode 100644 examples/declarative/animation/states/states.qmlproject create mode 100644 examples/declarative/animation/states/states.svg create mode 100644 examples/declarative/demos/calculator/calculator.desktop create mode 100644 examples/declarative/demos/calculator/calculator.png create mode 100644 examples/declarative/demos/calculator/calculator.pro create mode 100644 examples/declarative/demos/calculator/calculator.svg create mode 100644 examples/declarative/demos/calculator/main.cpp create mode 100644 examples/declarative/demos/calculator/qml/Core/Button.qml create mode 100644 examples/declarative/demos/calculator/qml/Core/Display.qml create mode 100644 examples/declarative/demos/calculator/qml/Core/calculator.js create mode 100644 examples/declarative/demos/calculator/qml/Core/images/button-.png create mode 100644 examples/declarative/demos/calculator/qml/Core/images/button-blue.png create mode 100644 examples/declarative/demos/calculator/qml/Core/images/button-green.png create mode 100644 examples/declarative/demos/calculator/qml/Core/images/button-purple.png create mode 100644 examples/declarative/demos/calculator/qml/Core/images/button-red.png create mode 100644 examples/declarative/demos/calculator/qml/Core/images/display.png create mode 100644 examples/declarative/demos/calculator/qml/Core/qmldir create mode 100644 examples/declarative/demos/calculator/qml/calculator.qml create mode 100644 examples/declarative/demos/calculator/qml/calculator.qmlproject create mode 100644 examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/demos/flickr/flickr.desktop create mode 100644 examples/declarative/demos/flickr/flickr.png create mode 100644 examples/declarative/demos/flickr/flickr.pro create mode 100644 examples/declarative/demos/flickr/flickr.svg create mode 100644 examples/declarative/demos/flickr/main.cpp create mode 100644 examples/declarative/demos/flickr/qml/common/Progress.qml create mode 100644 examples/declarative/demos/flickr/qml/common/RssModel.qml create mode 100644 examples/declarative/demos/flickr/qml/common/ScrollBar.qml create mode 100644 examples/declarative/demos/flickr/qml/common/Slider.qml create mode 100644 examples/declarative/demos/flickr/qml/common/qmldir create mode 100644 examples/declarative/demos/flickr/qml/flickr-90.qml create mode 100644 examples/declarative/demos/flickr/qml/flickr.qml create mode 100644 examples/declarative/demos/flickr/qml/flickr.qmlproject create mode 100644 examples/declarative/demos/flickr/qml/mobile/Button.qml create mode 100644 examples/declarative/demos/flickr/qml/mobile/GridDelegate.qml create mode 100644 examples/declarative/demos/flickr/qml/mobile/ImageDetails.qml create mode 100644 examples/declarative/demos/flickr/qml/mobile/ListDelegate.qml create mode 100644 examples/declarative/demos/flickr/qml/mobile/TitleBar.qml create mode 100644 examples/declarative/demos/flickr/qml/mobile/ToolBar.qml create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/gloss.png create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/lineedit.png create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/lineedit.sci create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/quit.png create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/stripes.png create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/titlebar.png create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/titlebar.sci create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/toolbutton.png create mode 100644 examples/declarative/demos/flickr/qml/mobile/images/toolbutton.sci create mode 100644 examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/demos/photoviewer/main.cpp create mode 100644 examples/declarative/demos/photoviewer/photoviewer.desktop create mode 100644 examples/declarative/demos/photoviewer/photoviewer.png create mode 100644 examples/declarative/demos/photoviewer/photoviewer.pro create mode 100644 examples/declarative/demos/photoviewer/photoviewer.svg create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/AlbumDelegate.qml create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/BusyIndicator.qml create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Button.qml create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/EditableButton.qml create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/PhotoDelegate.qml create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/ProgressBar.qml create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/RssModel.qml create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Tag.qml create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/box-shadow.png create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/busy.png create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/cardboard.png create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/qmldir create mode 100644 examples/declarative/demos/photoviewer/qml/PhotoViewerCore/script/script.js create mode 100644 examples/declarative/demos/photoviewer/qml/i18n/base.ts create mode 100644 examples/declarative/demos/photoviewer/qml/i18n/qml_fr.qm create mode 100644 examples/declarative/demos/photoviewer/qml/i18n/qml_fr.ts create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer.qmlproject create mode 100644 examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/demos/rssnews/main.cpp create mode 100644 examples/declarative/demos/rssnews/qml/content/BusyIndicator.qml create mode 100644 examples/declarative/demos/rssnews/qml/content/CategoryDelegate.qml create mode 100644 examples/declarative/demos/rssnews/qml/content/NewsDelegate.qml create mode 100644 examples/declarative/demos/rssnews/qml/content/RssFeeds.qml create mode 100644 examples/declarative/demos/rssnews/qml/content/ScrollBar.qml create mode 100644 examples/declarative/demos/rssnews/qml/content/images/busy.png create mode 100644 examples/declarative/demos/rssnews/qml/content/images/scrollbar.png create mode 100644 examples/declarative/demos/rssnews/qml/rssnews.qml create mode 100644 examples/declarative/demos/rssnews/qml/rssnews.qmlproject create mode 100644 examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/demos/rssnews/rssnews.desktop create mode 100644 examples/declarative/demos/rssnews/rssnews.png create mode 100644 examples/declarative/demos/rssnews/rssnews.pro create mode 100644 examples/declarative/demos/rssnews/rssnews.svg create mode 100644 examples/declarative/demos/samegame/main.cpp create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/BoomBlock.qml create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/Button.qml create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/Dialog.qml create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/background.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStar.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStone.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStar.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStone.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/redStar.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/redStone.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/star.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/pics/yellowStone.png create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/qmldir create mode 100644 examples/declarative/demos/samegame/qml/SamegameCore/samegame.js create mode 100644 examples/declarative/demos/samegame/qml/highscores/README create mode 100644 examples/declarative/demos/samegame/qml/highscores/score_data.xml create mode 100644 examples/declarative/demos/samegame/qml/highscores/score_style.xsl create mode 100644 examples/declarative/demos/samegame/qml/highscores/scores.php create mode 100644 examples/declarative/demos/samegame/qml/samegame.qml create mode 100644 examples/declarative/demos/samegame/qml/samegame.qmlproject create mode 100644 examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/demos/samegame/samegame.desktop create mode 100644 examples/declarative/demos/samegame/samegame.png create mode 100644 examples/declarative/demos/samegame/samegame.pro create mode 100644 examples/declarative/demos/samegame/samegame.svg create mode 100644 examples/declarative/demos/twitter/main.cpp create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/Button.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/FatDelegate.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/Input.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/Loading.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/MultiTitleBar.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/RssModel.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/SearchView.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/TitleBar.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/ToolBar.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/UserModel.qml create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/gloss.png create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.png create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.sci create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/loading.png create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/quit.png create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/stripes.png create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.png create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.sci create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.png create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.sci create mode 100644 examples/declarative/demos/twitter/qml/TwitterCore/qmldir create mode 100644 examples/declarative/demos/twitter/qml/twitter.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter.qmlproject create mode 100644 examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/demos/twitter/twitter.desktop create mode 100644 examples/declarative/demos/twitter/twitter.png create mode 100644 examples/declarative/demos/twitter/twitter.pro create mode 100644 examples/declarative/demos/twitter/twitter.svg create mode 100644 examples/declarative/demos/webbrowser/main.cpp create mode 100644 examples/declarative/demos/webbrowser/qml/content/Button.qml create mode 100644 examples/declarative/demos/webbrowser/qml/content/FlickableWebView.qml create mode 100644 examples/declarative/demos/webbrowser/qml/content/Header.qml create mode 100644 examples/declarative/demos/webbrowser/qml/content/ScrollBar.qml create mode 100644 examples/declarative/demos/webbrowser/qml/content/UrlInput.qml create mode 100644 examples/declarative/demos/webbrowser/qml/content/pics/display.png create mode 100644 examples/declarative/demos/webbrowser/qml/content/pics/edit-delete.png create mode 100644 examples/declarative/demos/webbrowser/qml/content/pics/go-jump-locationbar.png create mode 100644 examples/declarative/demos/webbrowser/qml/content/pics/go-next-view.png create mode 100644 examples/declarative/demos/webbrowser/qml/content/pics/go-previous-view.png create mode 100644 examples/declarative/demos/webbrowser/qml/content/pics/scrollbar.png create mode 100644 examples/declarative/demos/webbrowser/qml/content/pics/titlebar-bg.png create mode 100644 examples/declarative/demos/webbrowser/qml/content/pics/view-refresh.png create mode 100644 examples/declarative/demos/webbrowser/qml/webbrowser.qml create mode 100644 examples/declarative/demos/webbrowser/qml/webbrowser.qmlproject create mode 100644 examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/demos/webbrowser/webbrowser.desktop create mode 100644 examples/declarative/demos/webbrowser/webbrowser.png create mode 100644 examples/declarative/demos/webbrowser/webbrowser.pro create mode 100644 examples/declarative/demos/webbrowser/webbrowser.svg delete mode 100644 examples/declarative/examples.qmlproject create mode 100644 examples/declarative/i18n/i18n.desktop create mode 100644 examples/declarative/i18n/i18n.png create mode 100644 examples/declarative/i18n/i18n.pro delete mode 100644 examples/declarative/i18n/i18n.qmlproject create mode 100644 examples/declarative/i18n/i18n.svg delete mode 100644 examples/declarative/i18n/i18n/base.ts delete mode 100644 examples/declarative/i18n/i18n/qml_en_AU.qm delete mode 100644 examples/declarative/i18n/i18n/qml_en_AU.ts delete mode 100644 examples/declarative/i18n/i18n/qml_fr.qm delete mode 100644 examples/declarative/i18n/i18n/qml_fr.ts create mode 100644 examples/declarative/i18n/main.cpp create mode 100644 examples/declarative/i18n/qml/i18n.qml create mode 100644 examples/declarative/i18n/qml/i18n.qmlproject create mode 100644 examples/declarative/i18n/qml/i18n/base.ts create mode 100644 examples/declarative/i18n/qml/i18n/qml_en_AU.qm create mode 100644 examples/declarative/i18n/qml/i18n/qml_en_AU.ts create mode 100644 examples/declarative/i18n/qml/i18n/qml_fr.qm create mode 100644 examples/declarative/i18n/qml/i18n/qml_fr.ts create mode 100644 examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/imageelements/borderimage/borderimage.desktop create mode 100644 examples/declarative/imageelements/borderimage/borderimage.png create mode 100644 examples/declarative/imageelements/borderimage/borderimage.pro delete mode 100644 examples/declarative/imageelements/borderimage/borderimage.qmlproject create mode 100644 examples/declarative/imageelements/borderimage/borderimage.svg delete mode 100644 examples/declarative/imageelements/borderimage/content/bw.png delete mode 100644 examples/declarative/imageelements/borderimage/content/colors-round.sci delete mode 100644 examples/declarative/imageelements/borderimage/content/colors-stretch.sci delete mode 100644 examples/declarative/imageelements/borderimage/content/colors.png delete mode 100644 examples/declarative/imageelements/borderimage/content/shadow.png create mode 100644 examples/declarative/imageelements/borderimage/main.cpp create mode 100644 examples/declarative/imageelements/borderimage/qml/borderimage.qml create mode 100644 examples/declarative/imageelements/borderimage/qml/borderimage.qmlproject create mode 100644 examples/declarative/imageelements/borderimage/qml/content/MyBorderImage.qml create mode 100644 examples/declarative/imageelements/borderimage/qml/content/ShadowRectangle.qml create mode 100644 examples/declarative/imageelements/borderimage/qml/content/bw.png create mode 100644 examples/declarative/imageelements/borderimage/qml/content/colors-round.sci create mode 100644 examples/declarative/imageelements/borderimage/qml/content/colors-stretch.sci create mode 100644 examples/declarative/imageelements/borderimage/qml/content/colors.png create mode 100644 examples/declarative/imageelements/borderimage/qml/content/shadow.png create mode 100644 examples/declarative/imageelements/borderimage/qml/shadows.qml create mode 100644 examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/rules create mode 100644 examples/declarative/imageelements/image/image.desktop create mode 100644 examples/declarative/imageelements/image/image.png create mode 100644 examples/declarative/imageelements/image/image.pro delete mode 100644 examples/declarative/imageelements/image/image.qmlproject create mode 100644 examples/declarative/imageelements/image/image.svg create mode 100644 examples/declarative/imageelements/image/main.cpp create mode 100644 examples/declarative/imageelements/image/qml/ImageCell.qml create mode 100644 examples/declarative/imageelements/image/qml/image.qml create mode 100644 examples/declarative/imageelements/image/qml/image.qmlproject create mode 100644 examples/declarative/imageelements/image/qml/qt-logo.png create mode 100644 examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/imageelements/image/qt-logo.png delete mode 100644 examples/declarative/imageelements/imageelements.qmlproject create mode 100644 examples/declarative/imageelements/shadows/main.cpp create mode 100644 examples/declarative/imageelements/shadows/qml/borderimage.qml create mode 100644 examples/declarative/imageelements/shadows/qml/borderimage.qmlproject create mode 100644 examples/declarative/imageelements/shadows/qml/content/MyBorderImage.qml create mode 100644 examples/declarative/imageelements/shadows/qml/content/ShadowRectangle.qml create mode 100644 examples/declarative/imageelements/shadows/qml/content/bw.png create mode 100644 examples/declarative/imageelements/shadows/qml/content/colors-round.sci create mode 100644 examples/declarative/imageelements/shadows/qml/content/colors-stretch.sci create mode 100644 examples/declarative/imageelements/shadows/qml/content/colors.png create mode 100644 examples/declarative/imageelements/shadows/qml/content/shadow.png create mode 100644 examples/declarative/imageelements/shadows/qml/shadows.qml create mode 100644 examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/imageelements/shadows/shadows.desktop create mode 100644 examples/declarative/imageelements/shadows/shadows.png create mode 100644 examples/declarative/imageelements/shadows/shadows.pro create mode 100644 examples/declarative/imageelements/shadows/shadows.svg delete mode 100644 examples/declarative/keyinteraction/focus/Core/images/arrow.png delete mode 100644 examples/declarative/keyinteraction/focus/Core/images/qt-logo.png create mode 100644 examples/declarative/keyinteraction/focus/focus.desktop create mode 100644 examples/declarative/keyinteraction/focus/focus.png create mode 100644 examples/declarative/keyinteraction/focus/focus.pro delete mode 100644 examples/declarative/keyinteraction/focus/focus.qmlproject create mode 100644 examples/declarative/keyinteraction/focus/focus.svg create mode 100644 examples/declarative/keyinteraction/focus/main.cpp create mode 100644 examples/declarative/keyinteraction/focus/qml/Core/ContextMenu.qml create mode 100644 examples/declarative/keyinteraction/focus/qml/Core/GridMenu.qml create mode 100644 examples/declarative/keyinteraction/focus/qml/Core/ListMenu.qml create mode 100644 examples/declarative/keyinteraction/focus/qml/Core/ListViewDelegate.qml create mode 100644 examples/declarative/keyinteraction/focus/qml/Core/images/arrow.png create mode 100644 examples/declarative/keyinteraction/focus/qml/Core/images/qt-logo.png create mode 100644 examples/declarative/keyinteraction/focus/qml/focus.qml create mode 100644 examples/declarative/keyinteraction/focus/qml/focus.qmlproject create mode 100644 examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/keyinteraction/keyinteraction.qmlproject create mode 100644 examples/declarative/modelviews/Delegate/Delegate.desktop create mode 100644 examples/declarative/modelviews/Delegate/Delegate.png create mode 100644 examples/declarative/modelviews/Delegate/Delegate.pro create mode 100644 examples/declarative/modelviews/Delegate/Delegate.svg create mode 100644 examples/declarative/modelviews/Delegate/main.cpp create mode 100644 examples/declarative/modelviews/Delegate/qml/Delegate.qml create mode 100644 examples/declarative/modelviews/Delegate/qml/package.qmlproject create mode 100644 examples/declarative/modelviews/Delegate/qml/view.qml create mode 100644 examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/gridview-example/gridviewexample.desktop create mode 100644 examples/declarative/modelviews/gridview-example/gridviewexample.png create mode 100644 examples/declarative/modelviews/gridview-example/gridviewexample.pro create mode 100644 examples/declarative/modelviews/gridview-example/gridviewexample.svg create mode 100644 examples/declarative/modelviews/gridview-example/main.cpp create mode 100644 examples/declarative/modelviews/gridview-example/qml/gridview-example.qml create mode 100644 examples/declarative/modelviews/gridview-example/qml/gridview.qmlproject create mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png create mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png create mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png create mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png create mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png create mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png create mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png create mode 100644 examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/gridview/gridview.qmlproject delete mode 100644 examples/declarative/modelviews/gridview/pics/AddressBook_48.png delete mode 100644 examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png delete mode 100644 examples/declarative/modelviews/gridview/pics/Camera_48.png delete mode 100644 examples/declarative/modelviews/gridview/pics/DateBook_48.png delete mode 100644 examples/declarative/modelviews/gridview/pics/EMail_48.png delete mode 100644 examples/declarative/modelviews/gridview/pics/TodoList_48.png delete mode 100644 examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png delete mode 100644 examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg delete mode 100644 examples/declarative/modelviews/listview/content/pics/hamburger.jpg delete mode 100644 examples/declarative/modelviews/listview/content/pics/lemonade.jpg delete mode 100644 examples/declarative/modelviews/listview/content/pics/moreDown.png delete mode 100644 examples/declarative/modelviews/listview/content/pics/moreUp.png delete mode 100644 examples/declarative/modelviews/listview/content/pics/pancakes.jpg delete mode 100644 examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg create mode 100644 examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop create mode 100644 examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png create mode 100644 examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro create mode 100644 examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg create mode 100644 examples/declarative/modelviews/listview/dynamiclist/main.cpp create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.png create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/listview.qmlproject create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/main.cpp create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.png create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/listview.qmlproject create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules create mode 100644 examples/declarative/modelviews/listview/highlight/highlight.desktop create mode 100644 examples/declarative/modelviews/listview/highlight/highlight.png create mode 100644 examples/declarative/modelviews/listview/highlight/highlight.pro create mode 100644 examples/declarative/modelviews/listview/highlight/highlight.svg create mode 100644 examples/declarative/modelviews/listview/highlight/main.cpp create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.png create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png create mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg create mode 100644 examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qml/highlight.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qml/listview.qmlproject create mode 100644 examples/declarative/modelviews/listview/highlight/qml/sections.qml create mode 100644 examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules create mode 100644 examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop create mode 100644 examples/declarative/modelviews/listview/highlightranges/highlightranges.png create mode 100644 examples/declarative/modelviews/listview/highlightranges/highlightranges.pro create mode 100644 examples/declarative/modelviews/listview/highlightranges/highlightranges.svg create mode 100644 examples/declarative/modelviews/listview/highlightranges/main.cpp create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.png create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/listview.qmlproject create mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/sections.qml create mode 100644 examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/listview/listview.qmlproject create mode 100644 examples/declarative/modelviews/listview/sections/main.cpp create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.png create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png create mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg create mode 100644 examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml create mode 100644 examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml create mode 100644 examples/declarative/modelviews/listview/sections/qml/highlight.qml create mode 100644 examples/declarative/modelviews/listview/sections/qml/highlightranges.qml create mode 100644 examples/declarative/modelviews/listview/sections/qml/listview.qmlproject create mode 100644 examples/declarative/modelviews/listview/sections/qml/sections.qml create mode 100644 examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/listview/sections/sections.desktop create mode 100644 examples/declarative/modelviews/listview/sections/sections.png create mode 100644 examples/declarative/modelviews/listview/sections/sections.pro create mode 100644 examples/declarative/modelviews/listview/sections/sections.svg delete mode 100644 examples/declarative/modelviews/modelviews.qmlproject delete mode 100644 examples/declarative/modelviews/package/package.qmlproject create mode 100644 examples/declarative/modelviews/pathview-example/main.cpp create mode 100644 examples/declarative/modelviews/pathview-example/pathviewexample.desktop create mode 100644 examples/declarative/modelviews/pathview-example/pathviewexample.png create mode 100644 examples/declarative/modelviews/pathview-example/pathviewexample.pro create mode 100644 examples/declarative/modelviews/pathview-example/pathviewexample.svg create mode 100644 examples/declarative/modelviews/pathview-example/qml/pathview-example.qml create mode 100644 examples/declarative/modelviews/pathview-example/qml/pathview.qmlproject create mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png create mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png create mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png create mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png create mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png create mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png create mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png create mode 100644 examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules delete mode 100644 examples/declarative/modelviews/pathview/pathview.qmlproject delete mode 100644 examples/declarative/modelviews/pathview/pics/AddressBook_48.png delete mode 100644 examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png delete mode 100644 examples/declarative/modelviews/pathview/pics/Camera_48.png delete mode 100644 examples/declarative/modelviews/pathview/pics/DateBook_48.png delete mode 100644 examples/declarative/modelviews/pathview/pics/EMail_48.png delete mode 100644 examples/declarative/modelviews/pathview/pics/TodoList_48.png delete mode 100644 examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png create mode 100644 examples/declarative/modelviews/visualitemmodel/main.cpp create mode 100644 examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml create mode 100644 examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qmlproject create mode 100644 examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop create mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.png create mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro delete mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject create mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg delete mode 100644 examples/declarative/modelviews/webview/alerts.html create mode 100644 examples/declarative/modelviews/webview/alerts/alerts.desktop create mode 100644 examples/declarative/modelviews/webview/alerts/alerts.png create mode 100644 examples/declarative/modelviews/webview/alerts/alerts.pro create mode 100644 examples/declarative/modelviews/webview/alerts/alerts.svg create mode 100644 examples/declarative/modelviews/webview/alerts/main.cpp create mode 100644 examples/declarative/modelviews/webview/alerts/qml/alerts.html create mode 100644 examples/declarative/modelviews/webview/alerts/qml/alerts.qml create mode 100644 examples/declarative/modelviews/webview/alerts/qml/autosize.qml create mode 100644 examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml create mode 100644 examples/declarative/modelviews/webview/alerts/qml/content/Mapping/map.html create mode 100644 examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png create mode 100644 examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png create mode 100644 examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml create mode 100644 examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml create mode 100644 examples/declarative/modelviews/webview/alerts/qml/newwindows.html create mode 100644 examples/declarative/modelviews/webview/alerts/qml/newwindows.qml create mode 100644 examples/declarative/modelviews/webview/alerts/qml/webview.qmlproject create mode 100644 examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/webview/autosize/autosize.desktop create mode 100644 examples/declarative/modelviews/webview/autosize/autosize.png create mode 100644 examples/declarative/modelviews/webview/autosize/autosize.pro create mode 100644 examples/declarative/modelviews/webview/autosize/autosize.svg create mode 100644 examples/declarative/modelviews/webview/autosize/main.cpp create mode 100644 examples/declarative/modelviews/webview/autosize/qml/alerts.html create mode 100644 examples/declarative/modelviews/webview/autosize/qml/alerts.qml create mode 100644 examples/declarative/modelviews/webview/autosize/qml/autosize.qml create mode 100644 examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml create mode 100644 examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html create mode 100644 examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png create mode 100644 examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png create mode 100644 examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml create mode 100644 examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml create mode 100644 examples/declarative/modelviews/webview/autosize/qml/newwindows.html create mode 100644 examples/declarative/modelviews/webview/autosize/qml/newwindows.qml create mode 100644 examples/declarative/modelviews/webview/autosize/qml/webview.qmlproject create mode 100644 examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/rules delete mode 100755 examples/declarative/modelviews/webview/content/Mapping/map.html delete mode 100644 examples/declarative/modelviews/webview/content/pics/cancel.png delete mode 100644 examples/declarative/modelviews/webview/content/pics/ok.png create mode 100644 examples/declarative/modelviews/webview/googlemaps/googlemaps.desktop create mode 100644 examples/declarative/modelviews/webview/googlemaps/googlemaps.png create mode 100644 examples/declarative/modelviews/webview/googlemaps/googlemaps.pro create mode 100644 examples/declarative/modelviews/webview/googlemaps/googlemaps.svg create mode 100644 examples/declarative/modelviews/webview/googlemaps/main.cpp create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/alerts.html create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml create mode 100644 examples/declarative/modelviews/webview/googlemaps/qml/webview.qmlproject create mode 100644 examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/rules create mode 100644 examples/declarative/modelviews/webview/inlinehtml/inlinehtml.desktop create mode 100644 examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png create mode 100644 examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro create mode 100644 examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg create mode 100644 examples/declarative/modelviews/webview/inlinehtml/main.cpp create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qml/webview.qmlproject create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/rules delete mode 100644 examples/declarative/modelviews/webview/newwindows.html create mode 100644 examples/declarative/modelviews/webview/newwindows/main.cpp create mode 100644 examples/declarative/modelviews/webview/newwindows/newwindows.desktop create mode 100644 examples/declarative/modelviews/webview/newwindows/newwindows.png create mode 100644 examples/declarative/modelviews/webview/newwindows/newwindows.pro create mode 100644 examples/declarative/modelviews/webview/newwindows/newwindows.svg create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/alerts.html create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/alerts.qml create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/autosize.qml create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/Map.qml create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/map.html create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/content/pics/cancel.png create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/content/pics/ok.png create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/googlemaps.qml create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/inlinehtml.qml create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/newwindows.html create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/newwindows.qml create mode 100644 examples/declarative/modelviews/webview/newwindows/qml/webview.qmlproject create mode 100644 examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/webview/webview.qmlproject delete mode 100644 examples/declarative/positioners/add.png delete mode 100644 examples/declarative/positioners/del.png create mode 100644 examples/declarative/positioners/main.cpp create mode 100644 examples/declarative/positioners/positioners.desktop create mode 100644 examples/declarative/positioners/positioners.png create mode 100644 examples/declarative/positioners/positioners.pro delete mode 100644 examples/declarative/positioners/positioners.qmlproject create mode 100644 examples/declarative/positioners/positioners.svg create mode 100644 examples/declarative/positioners/qml/Button.qml create mode 100644 examples/declarative/positioners/qml/add.png create mode 100644 examples/declarative/positioners/qml/del.png create mode 100644 examples/declarative/positioners/qml/positioners.qml create mode 100644 examples/declarative/positioners/qml/positioners.qmlproject create mode 100644 examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject create mode 100644 examples/declarative/text/fonts/availableFonts/availableFonts.desktop create mode 100644 examples/declarative/text/fonts/availableFonts/availableFonts.png create mode 100644 examples/declarative/text/fonts/availableFonts/availableFonts.pro create mode 100644 examples/declarative/text/fonts/availableFonts/availableFonts.svg create mode 100644 examples/declarative/text/fonts/availableFonts/main.cpp create mode 100644 examples/declarative/text/fonts/availableFonts/qml/availableFonts.qml create mode 100644 examples/declarative/text/fonts/availableFonts/qml/banner.qml create mode 100644 examples/declarative/text/fonts/availableFonts/qml/fonts.qml create mode 100644 examples/declarative/text/fonts/availableFonts/qml/fonts.qmlproject create mode 100644 examples/declarative/text/fonts/availableFonts/qml/fonts/tarzeau_ocr_a.ttf create mode 100644 examples/declarative/text/fonts/availableFonts/qml/hello.qml create mode 100644 examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/text/fonts/banner/banner.desktop create mode 100644 examples/declarative/text/fonts/banner/banner.png create mode 100644 examples/declarative/text/fonts/banner/banner.pro create mode 100644 examples/declarative/text/fonts/banner/banner.svg create mode 100644 examples/declarative/text/fonts/banner/main.cpp create mode 100644 examples/declarative/text/fonts/banner/qml/availableFonts.qml create mode 100644 examples/declarative/text/fonts/banner/qml/banner.qml create mode 100644 examples/declarative/text/fonts/banner/qml/fonts.qml create mode 100644 examples/declarative/text/fonts/banner/qml/fonts.qmlproject create mode 100644 examples/declarative/text/fonts/banner/qml/fonts/tarzeau_ocr_a.ttf create mode 100644 examples/declarative/text/fonts/banner/qml/hello.qml create mode 100644 examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/text/fonts/fonts.qmlproject create mode 100644 examples/declarative/text/fonts/fonts/fonts.desktop create mode 100644 examples/declarative/text/fonts/fonts/fonts.png create mode 100644 examples/declarative/text/fonts/fonts/fonts.pro create mode 100644 examples/declarative/text/fonts/fonts/fonts.svg create mode 100644 examples/declarative/text/fonts/fonts/main.cpp create mode 100644 examples/declarative/text/fonts/fonts/qml/availableFonts.qml create mode 100644 examples/declarative/text/fonts/fonts/qml/banner.qml create mode 100644 examples/declarative/text/fonts/fonts/qml/fonts.qml create mode 100644 examples/declarative/text/fonts/fonts/qml/fonts.qmlproject create mode 100644 examples/declarative/text/fonts/fonts/qml/fonts/tarzeau_ocr_a.ttf create mode 100644 examples/declarative/text/fonts/fonts/qml/hello.qml create mode 100644 examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf create mode 100644 examples/declarative/text/fonts/hello/hello.desktop create mode 100644 examples/declarative/text/fonts/hello/hello.png create mode 100644 examples/declarative/text/fonts/hello/hello.pro create mode 100644 examples/declarative/text/fonts/hello/hello.svg create mode 100644 examples/declarative/text/fonts/hello/main.cpp create mode 100644 examples/declarative/text/fonts/hello/qml/availableFonts.qml create mode 100644 examples/declarative/text/fonts/hello/qml/banner.qml create mode 100644 examples/declarative/text/fonts/hello/qml/fonts.qml create mode 100644 examples/declarative/text/fonts/hello/qml/fonts.qmlproject create mode 100644 examples/declarative/text/fonts/hello/qml/fonts/tarzeau_ocr_a.ttf create mode 100644 examples/declarative/text/fonts/hello/qml/hello.qml create mode 100644 examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/text/text.qmlproject create mode 100644 examples/declarative/text/textselection/main.cpp delete mode 100644 examples/declarative/text/textselection/pics/endHandle.png delete mode 100644 examples/declarative/text/textselection/pics/endHandle.sci delete mode 100644 examples/declarative/text/textselection/pics/startHandle.png delete mode 100644 examples/declarative/text/textselection/pics/startHandle.sci create mode 100644 examples/declarative/text/textselection/qml/pics/endHandle.png create mode 100644 examples/declarative/text/textselection/qml/pics/endHandle.sci create mode 100644 examples/declarative/text/textselection/qml/pics/startHandle.png create mode 100644 examples/declarative/text/textselection/qml/pics/startHandle.sci create mode 100644 examples/declarative/text/textselection/qml/textselection.qml create mode 100644 examples/declarative/text/textselection/qml/textselection.qmlproject create mode 100644 examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/text/textselection/textselection.desktop create mode 100644 examples/declarative/text/textselection/textselection.png create mode 100644 examples/declarative/text/textselection/textselection.pro delete mode 100644 examples/declarative/text/textselection/textselection.qmlproject create mode 100644 examples/declarative/text/textselection/textselection.svg delete mode 100644 examples/declarative/threading/threading.qmlproject create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.desktop create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.png create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures.qml create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/qml/gestures.qmlproject create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/touchinteraction/gestures/gestures.qmlproject create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.desktop create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.png create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example.qml create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea.qmlproject create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/touchinteraction/mousearea/mousearea.qmlproject delete mode 100644 examples/declarative/touchinteraction/touchinteraction.qmlproject delete mode 100644 examples/declarative/toys/README create mode 100644 examples/declarative/toys/clocks/clocks.desktop create mode 100644 examples/declarative/toys/clocks/clocks.png create mode 100644 examples/declarative/toys/clocks/clocks.pro delete mode 100644 examples/declarative/toys/clocks/clocks.qmlproject create mode 100644 examples/declarative/toys/clocks/clocks.svg create mode 100644 examples/declarative/toys/clocks/main.cpp create mode 100644 examples/declarative/toys/clocks/qml/clocks.qml create mode 100644 examples/declarative/toys/clocks/qml/clocks.qmlproject create mode 100644 examples/declarative/toys/clocks/qml/content/Clock.qml create mode 100644 examples/declarative/toys/clocks/qml/content/QuitButton.qml create mode 100644 examples/declarative/toys/clocks/qml/content/background.png create mode 100644 examples/declarative/toys/clocks/qml/content/center.png create mode 100644 examples/declarative/toys/clocks/qml/content/clock-night.png create mode 100644 examples/declarative/toys/clocks/qml/content/clock.png create mode 100644 examples/declarative/toys/clocks/qml/content/hour.png create mode 100644 examples/declarative/toys/clocks/qml/content/minute.png create mode 100644 examples/declarative/toys/clocks/qml/content/quit.png create mode 100644 examples/declarative/toys/clocks/qml/content/second.png create mode 100644 examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/toys/corkboards/cork.jpg create mode 100644 examples/declarative/toys/corkboards/corkboards.desktop create mode 100644 examples/declarative/toys/corkboards/corkboards.png create mode 100644 examples/declarative/toys/corkboards/corkboards.pro delete mode 100644 examples/declarative/toys/corkboards/corkboards.qmlproject create mode 100644 examples/declarative/toys/corkboards/corkboards.svg create mode 100644 examples/declarative/toys/corkboards/main.cpp delete mode 100644 examples/declarative/toys/corkboards/note-yellow.png create mode 100644 examples/declarative/toys/corkboards/qml/Day.qml create mode 100644 examples/declarative/toys/corkboards/qml/cork.jpg create mode 100644 examples/declarative/toys/corkboards/qml/corkboards.qml create mode 100644 examples/declarative/toys/corkboards/qml/corkboards.qmlproject create mode 100644 examples/declarative/toys/corkboards/qml/note-yellow.png create mode 100644 examples/declarative/toys/corkboards/qml/tack.png create mode 100644 examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/toys/corkboards/tack.png create mode 100644 examples/declarative/toys/dynamicscene/dynamicscene.desktop create mode 100644 examples/declarative/toys/dynamicscene/dynamicscene.png create mode 100644 examples/declarative/toys/dynamicscene/dynamicscene.pro delete mode 100644 examples/declarative/toys/dynamicscene/dynamicscene.qmlproject create mode 100644 examples/declarative/toys/dynamicscene/dynamicscene.svg delete mode 100644 examples/declarative/toys/dynamicscene/images/NOTE delete mode 100644 examples/declarative/toys/dynamicscene/images/face-smile.png delete mode 100644 examples/declarative/toys/dynamicscene/images/moon.png delete mode 100644 examples/declarative/toys/dynamicscene/images/rabbit_brown.png delete mode 100644 examples/declarative/toys/dynamicscene/images/rabbit_bw.png delete mode 100644 examples/declarative/toys/dynamicscene/images/star.png delete mode 100644 examples/declarative/toys/dynamicscene/images/sun.png delete mode 100644 examples/declarative/toys/dynamicscene/images/tree_s.png create mode 100644 examples/declarative/toys/dynamicscene/main.cpp create mode 100644 examples/declarative/toys/dynamicscene/qml/dynamicscene.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/dynamicscene.qmlproject create mode 100644 examples/declarative/toys/dynamicscene/qml/images/NOTE create mode 100644 examples/declarative/toys/dynamicscene/qml/images/face-smile.png create mode 100644 examples/declarative/toys/dynamicscene/qml/images/moon.png create mode 100644 examples/declarative/toys/dynamicscene/qml/images/rabbit_brown.png create mode 100644 examples/declarative/toys/dynamicscene/qml/images/rabbit_bw.png create mode 100644 examples/declarative/toys/dynamicscene/qml/images/star.png create mode 100644 examples/declarative/toys/dynamicscene/qml/images/sun.png create mode 100644 examples/declarative/toys/dynamicscene/qml/images/tree_s.png delete mode 100644 examples/declarative/toys/dynamicscene/qml/itemCreation.js create mode 100644 examples/declarative/toys/dynamicscene/qml/qml/Button.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/qml/GenericSceneItem.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/qml/PaletteItem.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/qml/PerspectiveItem.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/qml/Sun.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/qml/itemCreation.js create mode 100644 examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/toys/tic-tac-toe/content/pics/board.png delete mode 100644 examples/declarative/toys/tic-tac-toe/content/pics/o.png delete mode 100644 examples/declarative/toys/tic-tac-toe/content/pics/x.png delete mode 100644 examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js create mode 100644 examples/declarative/toys/tic-tac-toe/main.cpp create mode 100644 examples/declarative/toys/tic-tac-toe/qml/content/Button.qml create mode 100644 examples/declarative/toys/tic-tac-toe/qml/content/TicTac.qml create mode 100644 examples/declarative/toys/tic-tac-toe/qml/content/pics/board.png create mode 100644 examples/declarative/toys/tic-tac-toe/qml/content/pics/o.png create mode 100644 examples/declarative/toys/tic-tac-toe/qml/content/pics/x.png create mode 100644 examples/declarative/toys/tic-tac-toe/qml/content/tic-tac-toe.js create mode 100644 examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qml create mode 100644 examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qmlproject create mode 100644 examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject create mode 100644 examples/declarative/toys/tic-tac-toe/tictactoe.desktop create mode 100644 examples/declarative/toys/tic-tac-toe/tictactoe.png create mode 100644 examples/declarative/toys/tic-tac-toe/tictactoe.pro create mode 100644 examples/declarative/toys/tic-tac-toe/tictactoe.svg delete mode 100644 examples/declarative/toys/toys.qmlproject create mode 100644 examples/declarative/toys/tvtennis/main.cpp create mode 100644 examples/declarative/toys/tvtennis/qml/tvtennis.qml create mode 100644 examples/declarative/toys/tvtennis/qml/tvtennis.qmlproject create mode 100644 examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/toys/tvtennis/tvtennis.desktop create mode 100644 examples/declarative/toys/tvtennis/tvtennis.png create mode 100644 examples/declarative/toys/tvtennis/tvtennis.pro delete mode 100644 examples/declarative/toys/tvtennis/tvtennis.qmlproject create mode 100644 examples/declarative/toys/tvtennis/tvtennis.svg delete mode 100644 examples/declarative/ui-components/README delete mode 100644 examples/declarative/ui-components/dialcontrol/content/background.png delete mode 100644 examples/declarative/ui-components/dialcontrol/content/needle.png delete mode 100644 examples/declarative/ui-components/dialcontrol/content/needle_shadow.png delete mode 100644 examples/declarative/ui-components/dialcontrol/content/overlay.png delete mode 100644 examples/declarative/ui-components/dialcontrol/content/quit.png create mode 100644 examples/declarative/ui-components/dialcontrol/dialcontrol.desktop create mode 100644 examples/declarative/ui-components/dialcontrol/dialcontrol.png create mode 100644 examples/declarative/ui-components/dialcontrol/dialcontrol.pro delete mode 100644 examples/declarative/ui-components/dialcontrol/dialcontrol.qmlproject create mode 100644 examples/declarative/ui-components/dialcontrol/dialcontrol.svg create mode 100644 examples/declarative/ui-components/dialcontrol/main.cpp create mode 100644 examples/declarative/ui-components/dialcontrol/qml/content/Dial.qml create mode 100644 examples/declarative/ui-components/dialcontrol/qml/content/QuitButton.qml create mode 100644 examples/declarative/ui-components/dialcontrol/qml/content/background.png create mode 100644 examples/declarative/ui-components/dialcontrol/qml/content/needle.png create mode 100644 examples/declarative/ui-components/dialcontrol/qml/content/needle_shadow.png create mode 100644 examples/declarative/ui-components/dialcontrol/qml/content/overlay.png create mode 100644 examples/declarative/ui-components/dialcontrol/qml/content/quit.png create mode 100644 examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qml create mode 100644 examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qmlproject create mode 100644 examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/ui-components/flipable/content/5_heart.png delete mode 100644 examples/declarative/ui-components/flipable/content/9_club.png delete mode 100644 examples/declarative/ui-components/flipable/content/back.png create mode 100644 examples/declarative/ui-components/flipable/flipable.desktop create mode 100644 examples/declarative/ui-components/flipable/flipable.png create mode 100644 examples/declarative/ui-components/flipable/flipable.pro delete mode 100644 examples/declarative/ui-components/flipable/flipable.qmlproject create mode 100644 examples/declarative/ui-components/flipable/flipable.svg create mode 100644 examples/declarative/ui-components/flipable/main.cpp create mode 100644 examples/declarative/ui-components/flipable/qml/content/5_heart.png create mode 100644 examples/declarative/ui-components/flipable/qml/content/9_club.png create mode 100644 examples/declarative/ui-components/flipable/qml/content/Card.qml create mode 100644 examples/declarative/ui-components/flipable/qml/content/back.png create mode 100644 examples/declarative/ui-components/flipable/qml/flipable.qml create mode 100644 examples/declarative/ui-components/flipable/qml/flipable.qmlproject create mode 100644 examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/ui-components/main/main.cpp create mode 100644 examples/declarative/ui-components/main/main.desktop create mode 100644 examples/declarative/ui-components/main/main.png create mode 100644 examples/declarative/ui-components/main/main.pro create mode 100644 examples/declarative/ui-components/main/main.svg create mode 100644 examples/declarative/ui-components/main/qml/ScrollBar.qml create mode 100644 examples/declarative/ui-components/main/qml/SearchBox.qml create mode 100644 examples/declarative/ui-components/main/qml/TabWidget.qml create mode 100644 examples/declarative/ui-components/main/qml/content/ProgressBar.qml create mode 100644 examples/declarative/ui-components/main/qml/content/Spinner.qml create mode 100644 examples/declarative/ui-components/main/qml/content/background.png create mode 100644 examples/declarative/ui-components/main/qml/content/spinner-bg.png create mode 100644 examples/declarative/ui-components/main/qml/content/spinner-select.png create mode 100644 examples/declarative/ui-components/main/qml/images/clear.png create mode 100644 examples/declarative/ui-components/main/qml/images/lineedit-bg-focus.png create mode 100644 examples/declarative/ui-components/main/qml/images/lineedit-bg.png create mode 100644 examples/declarative/ui-components/main/qml/main.qml create mode 100644 examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg create mode 100644 examples/declarative/ui-components/main/qml/progressbar.qmlproject create mode 100644 examples/declarative/ui-components/main/qml/scrollbar.qmlproject create mode 100644 examples/declarative/ui-components/main/qml/searchbox.qmlproject create mode 100644 examples/declarative/ui-components/main/qml/spinner.qmlproject create mode 100644 examples/declarative/ui-components/main/qml/tab.png create mode 100644 examples/declarative/ui-components/main/qml/tabwidget.qmlproject create mode 100644 examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/ui-components/progressbar/content/background.png create mode 100644 examples/declarative/ui-components/progressbar/main.cpp create mode 100644 examples/declarative/ui-components/progressbar/progressbar.desktop create mode 100644 examples/declarative/ui-components/progressbar/progressbar.png create mode 100644 examples/declarative/ui-components/progressbar/progressbar.pro delete mode 100644 examples/declarative/ui-components/progressbar/progressbar.qmlproject create mode 100644 examples/declarative/ui-components/progressbar/progressbar.svg create mode 100644 examples/declarative/ui-components/progressbar/qml/content/ProgressBar.qml create mode 100644 examples/declarative/ui-components/progressbar/qml/content/background.png create mode 100644 examples/declarative/ui-components/progressbar/qml/main.qml create mode 100644 examples/declarative/ui-components/progressbar/qml/progressbar.qmlproject create mode 100644 examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg delete mode 100644 examples/declarative/ui-components/scrollbar/scrollbar.qmlproject delete mode 100644 examples/declarative/ui-components/searchbox/images/clear.png delete mode 100644 examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png delete mode 100644 examples/declarative/ui-components/searchbox/images/lineedit-bg.png delete mode 100644 examples/declarative/ui-components/searchbox/searchbox.qmlproject delete mode 100644 examples/declarative/ui-components/slideswitch/content/background.svg delete mode 100644 examples/declarative/ui-components/slideswitch/content/knob.svg create mode 100644 examples/declarative/ui-components/slideswitch/main.cpp create mode 100644 examples/declarative/ui-components/slideswitch/qml/content/Switch.qml create mode 100644 examples/declarative/ui-components/slideswitch/qml/content/background.svg create mode 100644 examples/declarative/ui-components/slideswitch/qml/content/knob.svg create mode 100644 examples/declarative/ui-components/slideswitch/qml/slideswitch.qml create mode 100644 examples/declarative/ui-components/slideswitch/qml/slideswitch.qmlproject create mode 100644 examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/README create mode 100644 examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/changelog create mode 100644 examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/compat create mode 100644 examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/control create mode 100644 examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/copyright create mode 100755 examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/rules create mode 100644 examples/declarative/ui-components/slideswitch/slideswitch.desktop create mode 100644 examples/declarative/ui-components/slideswitch/slideswitch.png create mode 100644 examples/declarative/ui-components/slideswitch/slideswitch.pro delete mode 100644 examples/declarative/ui-components/slideswitch/slideswitch.qmlproject create mode 100644 examples/declarative/ui-components/slideswitch/slideswitch.svg delete mode 100644 examples/declarative/ui-components/spinner/content/spinner-bg.png delete mode 100644 examples/declarative/ui-components/spinner/content/spinner-select.png delete mode 100644 examples/declarative/ui-components/spinner/spinner.qmlproject delete mode 100644 examples/declarative/ui-components/tabwidget/tab.png delete mode 100644 examples/declarative/ui-components/tabwidget/tabwidget.qmlproject delete mode 100644 examples/declarative/ui-components/ui-components.qmlproject delete mode 100644 examples/declarative/xml/xml.qmlproject create mode 100644 examples/declarative/xml/xmlhttprequest-example/main.cpp create mode 100644 examples/declarative/xml/xmlhttprequest-example/qml/data.xml create mode 100644 examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example.qml create mode 100644 examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest.qmlproject create mode 100644 examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.desktop create mode 100644 examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.png create mode 100644 examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro create mode 100644 examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg delete mode 100644 examples/declarative/xml/xmlhttprequest/data.xml delete mode 100644 examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject create mode 100644 examples/designer/calculatorbuilder/calculatorbuilder.desktop create mode 100644 examples/designer/calculatorform/calculatorform.desktop create mode 100644 examples/designer/containerextension/containerextension.desktop create mode 100644 examples/designer/customwidgetplugin/customwidgetplugin.desktop create mode 100644 examples/designer/taskmenuextension/taskmenuextension.desktop create mode 100644 examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.desktop create mode 100644 examples/desktop/screenshot/screenshot.desktop create mode 100644 examples/desktop/systray/systray.desktop create mode 100644 examples/dialogs/classwizard/classwizard.desktop create mode 100644 examples/dialogs/configdialog/configdialog.desktop create mode 100644 examples/dialogs/extension/extension.desktop create mode 100644 examples/dialogs/findfiles/findfiles.desktop create mode 100644 examples/dialogs/licensewizard/licensewizard.desktop create mode 100644 examples/dialogs/sipdialog/sipdialog.desktop create mode 100644 examples/dialogs/standarddialogs/standarddialogs.desktop create mode 100644 examples/dialogs/tabdialog/tabdialog.desktop create mode 100644 examples/dialogs/trivialwizard/trivialwizard.desktop create mode 100644 examples/draganddrop/delayedencoding/delayedencoding.desktop create mode 100644 examples/draganddrop/draggableicons/draggableicons.desktop create mode 100644 examples/draganddrop/draggabletext/draggabletext.desktop create mode 100644 examples/draganddrop/dropsite/dropsite.desktop create mode 100644 examples/draganddrop/fridgemagnets/fridgemagnets.desktop create mode 100644 examples/draganddrop/puzzle/puzzle.desktop create mode 100644 examples/effects/blurpicker/blurpicker.desktop create mode 100644 examples/effects/fademessage/fademessage.desktop create mode 100644 examples/effects/lighting/lighting.desktop create mode 100644 examples/gestures/imagegestures/imagegestures.desktop create mode 100644 examples/graphicsview/anchorlayout/anchorlayout.desktop create mode 100644 examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.desktop create mode 100644 examples/graphicsview/collidingmice/collidingmice.desktop create mode 100644 examples/graphicsview/diagramscene/diagramscene.desktop create mode 100644 examples/graphicsview/dragdroprobot/dragdroprobot.desktop create mode 100644 examples/graphicsview/elasticnodes/elasticnodes.desktop create mode 100644 examples/graphicsview/flowlayout/flowlayout.desktop create mode 100644 examples/graphicsview/padnavigator/padnavigator.desktop create mode 100644 examples/graphicsview/portedasteroids/portedasteroids.desktop create mode 100644 examples/graphicsview/portedcanvas/portedcanvas.desktop create mode 100644 examples/graphicsview/simpleanchorlayout/simpleanchorlayout.desktop create mode 100644 examples/graphicsview/weatheranchorlayout/weatheranchorlayout.desktop create mode 100644 examples/help/contextsensitivehelp/contextsensitivehelp.desktop create mode 100644 examples/help/remotecontrol/remotecontrol.desktop create mode 100644 examples/help/simpletextviewer/simpletextviewer.desktop create mode 100644 examples/ipc/localfortuneclient/localfortuneclient.desktop create mode 100644 examples/ipc/localfortuneserver/localfortuneserver.desktop create mode 100644 examples/ipc/sharedmemory/sharedmemory.desktop create mode 100644 examples/itemviews/addressbook/addressbook.desktop create mode 100644 examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.desktop create mode 100644 examples/itemviews/chart/chart.desktop create mode 100644 examples/itemviews/coloreditorfactory/coloreditorfactory.desktop create mode 100644 examples/itemviews/combowidgetmapper/combowidgetmapper.desktop create mode 100644 examples/itemviews/customsortfiltermodel/customsortfiltermodel.desktop create mode 100644 examples/itemviews/dirview/dirview.desktop create mode 100644 examples/itemviews/editabletreemodel/editabletreemodel.desktop create mode 100644 examples/itemviews/fetchmore/fetchmore.desktop create mode 100644 examples/itemviews/frozencolumn/frozencolumn.desktop create mode 100644 examples/itemviews/pixelator/pixelator.desktop create mode 100644 examples/itemviews/puzzle/puzzle.desktop create mode 100644 examples/itemviews/simpledommodel/simpledommodel.desktop create mode 100644 examples/itemviews/simpletreemodel/simpletreemodel.desktop create mode 100644 examples/itemviews/simplewidgetmapper/simplewidgetmapper.desktop create mode 100644 examples/itemviews/spinboxdelegate/spinboxdelegate.desktop create mode 100644 examples/itemviews/stardelegate/stardelegate.desktop create mode 100644 examples/layouts/basiclayouts/basiclayouts.desktop create mode 100644 examples/layouts/borderlayout/borderlayout.desktop create mode 100644 examples/layouts/dynamiclayouts/dynamiclayouts.desktop create mode 100644 examples/layouts/flowlayout/flowlayout.desktop create mode 100644 examples/linguist/arrowpad/arrowpad.desktop create mode 100644 examples/linguist/hellotr/hellotr.desktop create mode 100644 examples/linguist/trollprint/trollprint.desktop create mode 100644 examples/maemo5pkgrules.pri create mode 100644 examples/mainwindows/application/application.desktop create mode 100644 examples/mainwindows/dockwidgets/dockwidgets.desktop create mode 100644 examples/mainwindows/mdi/mdi.desktop create mode 100644 examples/mainwindows/menus/menus.desktop create mode 100644 examples/mainwindows/recentfiles/recentfiles.desktop create mode 100644 examples/mainwindows/sdi/sdi.desktop create mode 100644 examples/multimedia/audiodevices/audiodevices.desktop create mode 100644 examples/multimedia/audioinput/audioinput.desktop create mode 100644 examples/multimedia/audiooutput/audiooutput.desktop create mode 100644 examples/multimedia/videographicsitem/videographicsitem.desktop create mode 100644 examples/multimedia/videowidget/videowidget.desktop create mode 100644 examples/network/bearercloud/bearercloud.desktop create mode 100644 examples/network/bearermonitor/bearermonitor.desktop create mode 100644 examples/network/blockingfortuneclient/blockingfortuneclient.desktop create mode 100644 examples/network/broadcastreceiver/broadcastreceiver.desktop create mode 100644 examples/network/broadcastsender/broadcastsender.desktop create mode 100644 examples/network/download/download.desktop create mode 100644 examples/network/downloadmanager/downloadmanager.desktop create mode 100644 examples/network/fortuneclient/fortuneclient.desktop create mode 100644 examples/network/fortuneserver/fortuneserver.desktop create mode 100644 examples/network/googlesuggest/googlesuggest.desktop create mode 100644 examples/network/http/http.desktop create mode 100644 examples/network/loopback/loopback.desktop create mode 100644 examples/network/network-chat/network-chat.desktop create mode 100644 examples/network/qftp/qftp.desktop create mode 100644 examples/network/securesocketclient/securesocketclient.desktop create mode 100644 examples/network/threadedfortuneserver/threadedfortuneserver.desktop create mode 100644 examples/network/torrent/torrent.desktop create mode 100644 examples/opengl/2dpainting/2dpainting.desktop create mode 100644 examples/opengl/cube/cube.desktop create mode 100644 examples/opengl/cube/cube.png create mode 100644 examples/opengl/cube/cube.pro create mode 100644 examples/opengl/cube/fshader.glsl create mode 100644 examples/opengl/cube/geometryengine.cpp create mode 100644 examples/opengl/cube/geometryengine.h create mode 100644 examples/opengl/cube/main.cpp create mode 100644 examples/opengl/cube/mainwidget.cpp create mode 100644 examples/opengl/cube/mainwidget.h create mode 100644 examples/opengl/cube/shaders.qrc create mode 100644 examples/opengl/cube/textures.qrc create mode 100644 examples/opengl/cube/vshader.glsl create mode 100644 examples/opengl/framebufferobject/framebufferobject.desktop create mode 100644 examples/opengl/framebufferobject2/framebufferobject2.desktop create mode 100644 examples/opengl/grabber/grabber.desktop create mode 100644 examples/opengl/hellogl/hellogl.desktop create mode 100644 examples/opengl/hellogl_es/hellogl_es.desktop create mode 100644 examples/opengl/hellogl_es2/hellogl_es2.desktop create mode 100644 examples/opengl/overpainting/overpainting.desktop create mode 100644 examples/opengl/pbuffers/pbuffers.desktop create mode 100644 examples/opengl/pbuffers2/pbuffers2.desktop create mode 100644 examples/opengl/samplebuffers/samplebuffers.desktop create mode 100644 examples/opengl/textures/textures.desktop create mode 100644 examples/openvg/openvg.desktop create mode 100644 examples/painting/basicdrawing/basicdrawing.desktop create mode 100644 examples/painting/concentriccircles/concentriccircles.desktop create mode 100644 examples/painting/fontsampler/fontsampler.desktop create mode 100644 examples/painting/imagecomposition/imagecomposition.desktop create mode 100644 examples/painting/painterpaths/painterpaths.desktop create mode 100644 examples/painting/svggenerator/svggenerator.desktop create mode 100644 examples/painting/svgviewer/svgviewer.desktop create mode 100644 examples/painting/transformations/transformations.desktop create mode 100644 examples/phonon/capabilities/capabilities.desktop create mode 100644 examples/phonon/qmusicplayer/qmusicplayer.desktop create mode 100644 examples/qt.png create mode 100644 examples/qt.svg create mode 100644 examples/qtconcurrent/imagescaling/imagescaling.desktop create mode 100644 examples/qtconcurrent/map/map.desktop create mode 100644 examples/qtconcurrent/progressdialog/progressdialog.desktop create mode 100644 examples/qtconcurrent/runfunction/runfunction.desktop create mode 100644 examples/qtconcurrent/wordcount/wordcount.desktop create mode 100644 examples/qtestlib/tutorial1/tutorial1.desktop create mode 100644 examples/qtestlib/tutorial2/tutorial2.desktop create mode 100644 examples/qtestlib/tutorial3/tutorial3.desktop create mode 100644 examples/qtestlib/tutorial4/tutorial4.desktop create mode 100644 examples/qtestlib/tutorial5/tutorial5.desktop create mode 100644 examples/qws/dbscreen/dbscreen.desktop create mode 100644 examples/qws/framebuffer/framebuffer.desktop create mode 100644 examples/qws/mousecalibration/mousecalibration.desktop create mode 100644 examples/qws/simpledecoration/simpledecoration.desktop create mode 100644 examples/qws/svgalib/svgalib.desktop create mode 100644 examples/richtext/calendar/calendar.desktop create mode 100644 examples/richtext/orderform/orderform.desktop create mode 100644 examples/richtext/syntaxhighlighter/syntaxhighlighter.desktop create mode 100644 examples/richtext/textobject/resources.qrc create mode 100644 examples/richtext/textobject/textobject.desktop create mode 100644 examples/script/calculator/calculator.desktop create mode 100644 examples/script/context2d/context2d.desktop create mode 100644 examples/script/customclass/customclass.desktop create mode 100644 examples/script/defaultprototypes/defaultprototypes.desktop create mode 100644 examples/script/helloscript/helloscript.desktop create mode 100644 examples/script/marshal/marshal.desktop create mode 100644 examples/script/qscript/qscript.desktop create mode 100644 examples/script/qsdbg/qsdbg.desktop create mode 100644 examples/script/qstetrix/qstetrix.desktop create mode 100644 examples/sql/cachedtable/cachedtable.desktop create mode 100644 examples/sql/drilldown/drilldown.desktop create mode 100644 examples/sql/masterdetail/masterdetail.desktop create mode 100644 examples/sql/querymodel/querymodel.desktop create mode 100644 examples/sql/relationaltablemodel/relationaltablemodel.desktop create mode 100644 examples/sql/sqlwidgetmapper/sqlwidgetmapper.desktop create mode 100644 examples/sql/tablemodel/tablemodel.desktop create mode 100644 examples/statemachine/eventtransitions/eventtransitions.desktop create mode 100644 examples/statemachine/factorial/factorial.desktop create mode 100644 examples/statemachine/pingpong/pingpong.desktop create mode 100644 examples/statemachine/rogue/rogue.desktop create mode 100644 examples/statemachine/trafficlight/trafficlight.desktop create mode 100644 examples/statemachine/twowaybutton/twowaybutton.desktop create mode 100644 examples/threads/mandelbrot/mandelbrot.desktop create mode 100644 examples/threads/queuedcustomtype/queuedcustomtype.desktop create mode 100644 examples/threads/semaphores/semaphores.desktop create mode 100644 examples/threads/waitconditions/waitconditions.desktop create mode 100644 examples/tools/codecs/codecs.desktop create mode 100644 examples/tools/completer/completer.desktop create mode 100644 examples/tools/contiguouscache/contiguouscache.desktop create mode 100644 examples/tools/customcompleter/customcompleter.desktop create mode 100644 examples/tools/customtype/customtype.desktop create mode 100644 examples/tools/customtypesending/customtypesending.desktop create mode 100644 examples/tools/echoplugin/echowindow/echowindow.desktop create mode 100644 examples/tools/echoplugin/plugin/plugin.desktop create mode 100644 examples/tools/i18n/i18n.desktop create mode 100644 examples/tools/inputpanel/inputpanel.desktop create mode 100644 examples/tools/plugandpaint/plugandpaint.desktop create mode 100644 examples/tools/regexp/regexp.desktop create mode 100644 examples/tools/settingseditor/settingseditor.desktop create mode 100644 examples/tools/treemodelcompleter/treemodelcompleter.desktop create mode 100644 examples/tools/undoframework/undoframework.desktop create mode 100644 examples/touch/dials/dials.desktop create mode 100644 examples/touch/fingerpaint/fingerpaint.desktop create mode 100644 examples/touch/knobs/knobs.desktop create mode 100644 examples/touch/pinchzoom/pinchzoom.desktop create mode 100644 examples/tutorials/addressbook-fr/part1/part1.desktop create mode 100644 examples/tutorials/addressbook-fr/part2/part2.desktop create mode 100644 examples/tutorials/addressbook-fr/part3/part3.desktop create mode 100644 examples/tutorials/addressbook-fr/part4/part4.desktop create mode 100644 examples/tutorials/addressbook-fr/part5/part5.desktop create mode 100644 examples/tutorials/addressbook-fr/part6/part6.desktop create mode 100644 examples/tutorials/addressbook-fr/part7/part7.desktop create mode 100644 examples/tutorials/addressbook/part1/part1.desktop create mode 100644 examples/tutorials/addressbook/part2/part2.desktop create mode 100644 examples/tutorials/addressbook/part3/part3.desktop create mode 100644 examples/tutorials/addressbook/part4/part4.desktop create mode 100644 examples/tutorials/addressbook/part5/part5.desktop create mode 100644 examples/tutorials/addressbook/part6/part6.desktop create mode 100644 examples/tutorials/addressbook/part7/part7.desktop create mode 100644 examples/tutorials/modelview/1_readonly/1_readonly.desktop create mode 100644 examples/tutorials/modelview/2_formatting/2_formatting.desktop create mode 100644 examples/tutorials/modelview/3_changingmodel/3_changingmodel.desktop create mode 100644 examples/tutorials/modelview/4_headers/4_headers.desktop create mode 100644 examples/tutorials/modelview/5_edit/5_edit.desktop create mode 100644 examples/tutorials/modelview/6_treeview/6_treeview.desktop create mode 100644 examples/tutorials/modelview/7_selections/7_selections.desktop create mode 100644 examples/tutorials/widgets/childwidget/childwidget.desktop create mode 100644 examples/tutorials/widgets/nestedlayouts/nestedlayouts.desktop create mode 100644 examples/tutorials/widgets/toplevel/toplevel.desktop create mode 100644 examples/tutorials/widgets/windowlayout/windowlayout.desktop create mode 100644 examples/uitools/multipleinheritance/multipleinheritance.desktop create mode 100644 examples/uitools/textfinder/textfinder.desktop create mode 100644 examples/webkit/domtraversal/domtraversal.desktop create mode 100644 examples/webkit/domtraversal/window_mobiles.ui create mode 100644 examples/webkit/fancybrowser/fancybrowser.desktop create mode 100644 examples/webkit/formextractor/formextractor.desktop create mode 100644 examples/webkit/formextractor/formextractor_mobiles.ui create mode 100644 examples/webkit/framecapture/framecapture.desktop create mode 100644 examples/webkit/googlechat/googlechat.desktop create mode 100644 examples/webkit/previewer/previewer.desktop create mode 100644 examples/webkit/previewer/previewer_mobiles.ui create mode 100644 examples/webkit/simpleselector/simpleselector.desktop create mode 100644 examples/widgets/analogclock/analogclock.desktop create mode 100644 examples/widgets/applicationicon/applicationicon.desktop create mode 100644 examples/widgets/applicationicon/applicationicon.png create mode 100644 examples/widgets/applicationicon/applicationicon.pro create mode 100644 examples/widgets/applicationicon/applicationicon.svg create mode 100644 examples/widgets/applicationicon/main.cpp create mode 100644 examples/widgets/calculator/calculator.desktop create mode 100644 examples/widgets/calculator/releasenotes.txt create mode 100644 examples/widgets/calendarwidget/calendarwidget.desktop create mode 100644 examples/widgets/charactermap/charactermap.desktop create mode 100644 examples/widgets/codeeditor/codeeditor.desktop create mode 100644 examples/widgets/digitalclock/digitalclock.desktop create mode 100644 examples/widgets/elidedlabel/elidedlabel.cpp create mode 100644 examples/widgets/elidedlabel/elidedlabel.desktop create mode 100644 examples/widgets/elidedlabel/elidedlabel.h create mode 100644 examples/widgets/elidedlabel/elidedlabel.pro create mode 100644 examples/widgets/elidedlabel/main.cpp create mode 100644 examples/widgets/elidedlabel/testwidget.cpp create mode 100644 examples/widgets/elidedlabel/testwidget.h create mode 100644 examples/widgets/groupbox/groupbox.desktop create mode 100644 examples/widgets/icons/icons.desktop create mode 100644 examples/widgets/imageviewer/imageviewer.desktop create mode 100644 examples/widgets/lineedits/lineedits.desktop create mode 100644 examples/widgets/maemovibration/buttonwidget.cpp create mode 100644 examples/widgets/maemovibration/buttonwidget.h create mode 100644 examples/widgets/maemovibration/data/48x48/maemovibration.png create mode 100644 examples/widgets/maemovibration/data/64x64/maemovibration.png create mode 100644 examples/widgets/maemovibration/data/maemovibration.desktop create mode 100644 examples/widgets/maemovibration/data/maemovibration.service create mode 100644 examples/widgets/maemovibration/maemovibration.pro create mode 100644 examples/widgets/maemovibration/main.cpp create mode 100644 examples/widgets/maemovibration/mcevibrator.cpp create mode 100644 examples/widgets/maemovibration/mcevibrator.h create mode 100644 examples/widgets/movie/movie.desktop create mode 100644 examples/widgets/orientation/image_a.png create mode 100644 examples/widgets/orientation/image_b.png create mode 100644 examples/widgets/orientation/image_c.png create mode 100644 examples/widgets/orientation/images.qrc create mode 100644 examples/widgets/orientation/landscape.ui create mode 100644 examples/widgets/orientation/main.cpp create mode 100644 examples/widgets/orientation/mainwindow.cpp create mode 100644 examples/widgets/orientation/mainwindow.h create mode 100644 examples/widgets/orientation/orientation.desktop create mode 100644 examples/widgets/orientation/orientation.pro create mode 100644 examples/widgets/orientation/portrait.ui create mode 100644 examples/widgets/scribble/scribble.desktop create mode 100644 examples/widgets/shapedclock/shapedclock.desktop create mode 100644 examples/widgets/sliders/sliders.desktop create mode 100644 examples/widgets/softkeys/softkeys.desktop create mode 100644 examples/widgets/spinboxes/spinboxes.desktop create mode 100644 examples/widgets/styles/styles.desktop create mode 100644 examples/widgets/stylesheet/stylesheet.desktop create mode 100644 examples/widgets/symbianvibration/main.cpp create mode 100644 examples/widgets/symbianvibration/mainwindow.cpp create mode 100644 examples/widgets/symbianvibration/mainwindow.h create mode 100644 examples/widgets/symbianvibration/symbianvibration.pro create mode 100644 examples/widgets/symbianvibration/vibrationsurface.cpp create mode 100644 examples/widgets/symbianvibration/vibrationsurface.h create mode 100644 examples/widgets/symbianvibration/xqvibra.cpp create mode 100644 examples/widgets/symbianvibration/xqvibra.h create mode 100644 examples/widgets/symbianvibration/xqvibra_p.cpp create mode 100644 examples/widgets/symbianvibration/xqvibra_p.h create mode 100644 examples/widgets/tablet/tablet.desktop create mode 100644 examples/widgets/tetrix/tetrix.desktop create mode 100644 examples/widgets/tooltips/tooltips.desktop create mode 100644 examples/widgets/validators/validators.desktop create mode 100644 examples/widgets/wiggly/wiggly.desktop create mode 100644 examples/widgets/windowflags/windowflags.desktop create mode 100644 examples/xml/dombookmarks/dombookmarks.desktop create mode 100644 examples/xml/htmlinfo/htmlinfo.desktop create mode 100644 examples/xml/htmlinfo/resources.qrc create mode 100644 examples/xml/rsslisting/rsslisting.desktop create mode 100644 examples/xml/saxbookmarks/saxbookmarks.desktop create mode 100644 examples/xml/streambookmarks/streambookmarks.desktop create mode 100644 examples/xml/xmlstreamlint/xmlstreamlint.desktop create mode 100644 examples/xmlpatterns/filetree/filetree.desktop create mode 100644 examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.desktop create mode 100644 examples/xmlpatterns/recipes/forms/querywidget_mobiles.ui create mode 100644 examples/xmlpatterns/recipes/recipes.desktop create mode 100644 examples/xmlpatterns/schema/schema.desktop create mode 100644 examples/xmlpatterns/schema/schema_mobiles.ui create mode 100644 examples/xmlpatterns/trafficinfo/trafficinfo.desktop create mode 100644 examples/xmlpatterns/xquery/globalVariables/globalVariables.desktop create mode 100644 src/gui/styles/qs60style_feedbackinterface_p.h create mode 100644 src/plugins/s60/feedback/feedback.pro create mode 100644 src/plugins/s60/feedback/qtactileFeedback.h create mode 100644 src/plugins/s60/feedback/qtactileFeedback_s60.cpp create mode 100755 tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.png~HEAD create mode 100755 tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.png~HEAD create mode 100755 tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.png~HEAD create mode 100755 tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.png~HEAD create mode 100644 tools/qdoc3/doc/corefeatures.qdoc diff --git a/.commit-template b/.commit-template index 589ca89..6e0e3a4 100644 --- a/.commit-template +++ b/.commit-template @@ -5,6 +5,6 @@ # ---[ Fields ]-----------------[ uncomment and edit as applicable ]---| #Task-number: -#Reviewed-by: +Reviewed-by: pending # ==================================[ please wrap at 72 characters ]===| diff --git a/doc/doc.pri b/doc/doc.pri index 68d729b..253e1b4 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -13,12 +13,14 @@ win32:!win32-g++* { unixstyle = true } +COPYWEBKITGUIDE = $$QT_SOURCE_TREE/examples/webkit/webkit-guide + $$unixstyle { QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/bin/qdoc3 $$DOCS_GENERATION_DEFINES - COPYWEBKITGUIDE = $$QT_SOURCE_TREE/examples/webkit/webkit-guide } else { QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/bin/qdoc3.exe $$DOCS_GENERATION_DEFINES QDOC = $$replace(QDOC, "/", "\\") + COPYWEBKITGUIDE = $$replace(COPYWEBKITGUIDE, "/", "\\") } ADP_DOCS_QDOCCONF_FILE = qt-build-docs-online.qdocconf QT_DOCUMENTATION = ($$QDOC qt-api-only.qdocconf assistant.qdocconf designer.qdocconf \ diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 93571bd..8367c0f 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -147,4 +147,12 @@ examples for porting} \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/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index 23dd390..30167d7 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -422,3 +422,84 @@ a function in the model, e.g.: 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/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc index 3659caa..02d88ae 100644 --- a/doc/src/declarative/qtbinding.qdoc +++ b/doc/src/declarative/qtbinding.qdoc @@ -465,6 +465,10 @@ below right calls this function, passing a QVariantList and a QVariantMap, which 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 diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index 4a6f6a9..3930d3d 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -210,4 +210,4 @@ #include to use this function. Returns the QML type id. - */ +*/ diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index dea5aa1..65879b3 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1719,6 +1719,9 @@ executable. If you need to install executable files, you can unset the files' executable flags. + Note that \c qmake will skip files that are executable. If you need to install + executable files, you can unset the files' executable flags. + \target LEXIMPLS \section1 LEXIMPLS @@ -1811,6 +1814,8 @@ \bold{Note:} On the Symbian platform, this variable is ignored. + \bold{Note:} On the Symbian platform, this variable is ignored. + \target MAKEFILE_GENERATOR \section1 MAKEFILE_GENERATOR diff --git a/doc/src/development/qtestlib.qdoc b/doc/src/development/qtestlib.qdoc index 44b682a..65677be 100644 --- a/doc/src/development/qtestlib.qdoc +++ b/doc/src/development/qtestlib.qdoc @@ -751,8 +751,8 @@ Tools for handling and visualizing test data are available as part of the \l {qtestlib-tools} project in the \l{Qt Labs} web site. - These include a tool for comparing performance data obtained from test - runs and a utility to generate Web-based graphs of performance data. + These include a tool for comparing performance data obtained from test + runs and a utility to generate Web-based graphs of performance data. See the \l{qtestlib-tools Announcement}{qtestlib-tools announcement} for more information on these tools and a simple graphing example. diff --git a/doc/src/examples/applicationicon.qdoc b/doc/src/examples/applicationicon.qdoc new file mode 100644 index 0000000..d03bf36 --- /dev/null +++ b/doc/src/examples/applicationicon.qdoc @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in a +** written agreement between you and Nokia. +** +** 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! \example widgets/applicationicon + \group all-examples + \title Application Icon Example + + The example shows how to add an application icon to a mobile application. + + \image appicon_screenshot.png The icon on a Nokia XPressMusic 5800 + + \section1 Creating an icon for Maemo + + Maemo expects the icon of an application to be a 64x64 PNG image file. The + file name of the icon should be the same as the executable with a \c .png + extension. You also need a \c .desktop file that gives the window manager + hints about the application, such as name, type and icon. + + \quotefile examples/widgets/applicationicon/applicationicon.desktop + + The \c Icon field should also contain the name of the executable. On the + device, application icons are stored in the + \c /usr/share/icons/hicolor/64x64/apps directory + and desktop files in the \c /usr/share/applications/hildon directory. + + \section1 Creating an icon for Symbian + + Symbian uses Scalable Vector Graphics (SVG Tiny 1.1+) to render + application icons in the application menu. Therefore icons could be + created manually with a text editor, since SVG files are plain text with + XML syntax, but usually you would use a vector graphics program that is + able to output SVG files. Popular graphics programs such as Adobe + Illustrator or Inkscape are able to do so. + + For best results, the icon should be created on a 44x44 pixel canvas. + Otherwise the image might be scaled in unexpected ways. + + Once you have created your icon, make sure that it is stored according to + the SVG-Tiny 1.1+ standard. Inkscape, for instance, is not able to save + images that way, but there are tools that can convert general SVG files + into the Tiny format. For instance, the svg2svgt tool that is bundled with + Symbian 3rd and 5th editon SDKs under the folder s60tools can do this + conversion to some extent. Another tool to convert SVG to SVG Tiny is SVG + Pony. + + \section1 Adding the icons to the project + + Edit the .pro file and specify the ICON variable for the symbian target. + For Maemo, we need to add that the \c .desktop and icon file should be + installed. + + \quotefile examples/widgets/applicationicon/applicationicon.pro + + Currently, Qt Creator doesn't include the icon and desktop files in the + application package for Maemo, merely the executable file is included. As a + workaround for this, the files can be added manually in the Projects tab. + In the "Create Package" build step for the Maemo target, the \c .desktop + file and icon can be added to be a part of the package contents. + Unfortunately, these additions are only stored as a part of the + \c .pro.user file. This issue will be resolved in a future release of + Qt Creator. + + \image appicon_packagecontents.png Manual addition of files to the "Create Package" build step +*/ diff --git a/doc/src/examples/broadcastreceiver.qdoc b/doc/src/examples/broadcastreceiver.qdoc index ea3c331..3d127dc 100644 --- a/doc/src/examples/broadcastreceiver.qdoc +++ b/doc/src/examples/broadcastreceiver.qdoc @@ -29,7 +29,7 @@ \example network/broadcastreceiver \title Broadcast Receiver Example - The Broadcast Receiever example shows how to receive information that is broadcasted + The Broadcast Receiver example shows how to receive information that is broadcasted over a local network. \image broadcastreceiver-example.png diff --git a/doc/src/examples/combowidgetmapper.qdoc b/doc/src/examples/combowidgetmapper.qdoc index 897d135..e305052 100644 --- a/doc/src/examples/combowidgetmapper.qdoc +++ b/doc/src/examples/combowidgetmapper.qdoc @@ -29,7 +29,7 @@ \example itemviews/combowidgetmapper \title Combo Widget Mapper Example - The Delegate Widget Mapper example shows how to use a custom delegate to + The Combo Widget Mapper example shows how to use a custom delegate to map information from a model to specific widgets on a form. \image combowidgetmapper-example.png diff --git a/doc/src/examples/cube.qdoc b/doc/src/examples/cube.qdoc new file mode 100644 index 0000000..0603941 --- /dev/null +++ b/doc/src/examples/cube.qdoc @@ -0,0 +1,178 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example opengl/cube + \group all-examples + \title Cube OpenGL ES 2.0 example + + The Cube OpenGL ES 2.0 example shows how to write mouse rotateable + textured 3D cube using OpenGL ES 2.0 with Qt. It shows how to handle + polygon geometries efficiently and how to write simple vertex and + fragment shader for programmable graphics pipeline. In addition it + shows how to use quaternions for representing 3D object orientation. + + This example has been written for OpenGL ES 2.0 but it works also on + desktop OpenGL because this example is simple enough and for the + most parts desktop OpenGL API is same. It compiles also without OpenGL + support but then it just shows a label stating that OpenGL support is + required. + + \image cube.png Screenshot of the Cube example running on N900 + + The example consist of two classes: + + \list + \o \c MainWidget extends QGLWidget and contains OpenGL ES 2.0 + initialization and drawing and mouse and timer event handling + \o \c GeometryEngine handles polygon geometries. Transfers polygon geometry + to vertex buffer objects and draws geometries from vertex buffer objects. + \endlist + + We'll start by initializing OpenGL ES 2.0 in \c MainWidget. + + \tableofcontents + + \section1 Initializing OpenGL ES 2.0 + + Since OpenGL ES 2.0 doesn't support fixed graphics pipeline anymore it has to + be implemented by ourselves. This makes graphics pipeline very flexible but + in the same time it becomes more difficult because user has to implement graphics + pipeline to get even the simplest example running. It also makes graphics pipeline + more efficient because user can decide what kind of pipeline is needed for the + application. + + First we have to implement vertex shader. It gets vertex data and + model-view-projection matrix (MVP) as parameters. It transforms vertex position + using MVP matrix to screen space and passes texture coordinate to + fragment shader. Texture coordinate will be automatically interpolated on polygon + faces. + + \snippet examples/opengl/cube/vshader.glsl 0 + + After that we need to implement second part of the graphics pipeline - fragment + shader. For this exercise we need to implement fragment shader that handles + texturing. It gets interpolated texture coordinate as a parameter and looks up + fragment color from the given texture. + + \snippet examples/opengl/cube/fshader.glsl 0 + + Using \c QGLShaderProgram we can compile, link and bind shader code to + graphics pipeline. This code uses Qt Resource files to access shader source code. + + \snippet examples/opengl/cube/mainwidget.cpp 3 + + The following code enables depth buffering and back face culling. + + \snippet examples/opengl/cube/mainwidget.cpp 2 + + \section1 Loading textures from Qt Resource files + + \c QGLWidget interface implements methods for loading textures from QImage to GL + texture memory. We still need to use OpenGL provided functions for specifying + the GL texture unit and configuring texture filtering options. + + \snippet examples/opengl/cube/mainwidget.cpp 4 + + \section1 Cube Geometry + + There are many ways to render polygons in OpenGL but the most efficient way is + to use only triangle strip primitives and render vertices from graphics hardware + memory. OpenGL has a mechanism to create buffer objects to this memory area and + transfer vertex data to these buffers. In OpenGL terminology these are referred + as Vertex Buffer Objects (VBO). + + \image cube_faces.png Cube faces and vertices + + This is how cube faces break down to triangles. Vertices are ordered this way + to get vertex ordering correct using triangle strips. OpenGL determines triangle + front and back face based on vertex ordering. By default OpenGL uses + counter-clockwise order for front faces. This information is used by back face + culling which improves rendering performance by not rendering back faces of the + triangles. This way graphics pipeline can omit rendering sides of the triangle that + aren't facing towards screen. + + Creating vertex buffer objects and transferring data to them is quite simple using + OpenGL provided functions. + + \snippet examples/opengl/cube/geometryengine.cpp 0 + + \snippet examples/opengl/cube/geometryengine.cpp 1 + + Drawing primitives from VBOs and telling programmable graphics pipeline how to + locate vertex data requires few steps. First we need to bind VBOs to be used. + After that we bind shader program attribute names and configure what + kind of data it has in the bound VBO. Finally we'll draw triangle + strip primitives using indices from the other VBO. + + \snippet examples/opengl/cube/geometryengine.cpp 2 + + \section1 Perspective projection + + Using \c QMatrix4x4 helper methods it's really easy to calculate perpective + projection matrix. This matrix is used to project vertices to screen space. + + \snippet examples/opengl/cube/mainwidget.cpp 5 + + \section1 Orientation of the 3D object + + Quaternions are handy way to represent orientation of the 3D object. Quaternions + involve quite complex mathematics but fortunately all the necessary mathematics + behind quaternions is implemented in \c QQuaternion. That allows us to store + cube orientation in quaternion and rotating cube around given axis is quite + simple. + + The following code calculates rotation axis and angular speed based on mouse events. + + \snippet examples/opengl/cube/mainwidget.cpp 0 + + \c QBasicTimer is used to animate scene and update cube orientation. Rotations + can be concatenated simply by multiplying quaternions. + + \snippet examples/opengl/cube/mainwidget.cpp 1 + + Model-view matrix is calculated using the quaternion and by moving world by Z axis. + This matrix is multiplied with the projection matrix to get MVP matrix for shader + program. + + \snippet examples/opengl/cube/mainwidget.cpp 6 + +*/ diff --git a/doc/src/examples/dragdroprobot.qdoc b/doc/src/examples/dragdroprobot.qdoc index bcf0fe7..0a09314 100644 --- a/doc/src/examples/dragdroprobot.qdoc +++ b/doc/src/examples/dragdroprobot.qdoc @@ -29,7 +29,7 @@ \example graphicsview/dragdroprobot \title Drag and Drop Robot Example - This GraphicsView example shows how to implement Drag and Drop in a + The Drag and Drop Robot example shows how to implement Drag and Drop in a QGraphicsItem subclass, as well as how to animate items using Qt's \l{Animation Framework}. diff --git a/doc/src/examples/elasticnodes.qdoc b/doc/src/examples/elasticnodes.qdoc index bba6d90..8526d55 100644 --- a/doc/src/examples/elasticnodes.qdoc +++ b/doc/src/examples/elasticnodes.qdoc @@ -29,7 +29,7 @@ \example graphicsview/elasticnodes \title Elastic Nodes Example - This GraphicsView example shows how to implement edges between nodes in a + The Elastic Nodes example shows how to implement edges between nodes in a graph, with basic interaction. You can click to drag a node around, and zoom in and out using the mouse wheel or the keyboard. Hitting the space bar will randomize the nodes. The example is also resolution independent; diff --git a/doc/src/examples/elidedlabel.qdoc b/doc/src/examples/elidedlabel.qdoc new file mode 100644 index 0000000..4c6e8e8 --- /dev/null +++ b/doc/src/examples/elidedlabel.qdoc @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in a +** written agreement between you and Nokia. +** +** 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example widgets/elidedlabel + \group all-examples + \title Elided Label Example + + This example creates a widget similar to QLabel, that elides the last + visible line, if the text is too long to fit the widget's geometry. + + \image elidedlabel-example.png Elided Label example on XPressMusic 5800 + + When text of varying length has to be displayed in a uniformly sized + area, for instance within a list or grid view where all list items have the + same size, it can be useful to give the user a visual clue when not all + text is visible. QLabel can elide text that doesn't fit within it, but only + in one line. The \c ElidedLabel widget shown in this example word wraps its + text by its width, and elides the last visible line if some text is left + out. \c TestWidget gives control to the features of \c ElidedWidget and + forms the example application. + + + \section1 ElidedLabel Class Definition + + Like QLabel, \c ElidedLabel inherits from QFrame. Here's the definition of + the \c ElidedLabel class: + + + \snippet examples/widgets/elidedlabel/elidedlabel.h 0 + + The \c isElided property depends the font, text content and geometry of the + widget. Whenever any of these change, the \c elisionChanged() signal might + trigger. We cache the current elision value in \c elided, so that it + doesn't have to be recomputed every time it's asked for. + + + \section1 ElidedLabel Class Implementation + + Except for initializing the member variables, the constructor sets the size + policy to be horizontally expanding, since it's meant to fill the width of + its container and grow vertically. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 0 + + Changing the \c content require a repaint of the widget. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 1 + + QTextLayout is used in the \c paintEvent() to divide the \c content into + lines, that wrap on word boundaries. Each line, except the last visible + one, is drawn \c lineSpacing pixels below the previous one. The \c draw() + method of QTextLine will draw the line using the coordinate point as the + top left corner. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 2 + + Unfortunately, QTextLayout does not elide text, so the last visible line + has to be treated differently. This last line is elided if it is too wide. + The \c drawText() method of QPainter draws the text starting from the base + line, which is \c ascecnt() pixels below the last drawn line. + + Finally, one more line is created to see if everything fit on this line. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 3 + + If the text was elided and wasn't before or vice versa, cache it in + \c elided and emit the change. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 4 + + + \section1 TestWidget Class Definition + + \c TestWidget is a QWidget and is the main window of the example. It + contains an \c ElidedLabel which can be resized with two QSlider widgets. + + \snippet examples/widgets/elidedlabel/testwidget.h 0 + + \section1 TestWidget Class Implementation + + The constructor initializes the whole widget. Strings of different length + are stored in \c textSamples. The user is able to switch between these. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 0 + + An \c ElidedLabel is created to contain the first of the sample strings. + The frame is made visible to make it easier to see the actual size of the + widget. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 1 + + The buttons and the elision label are created. By connecting the + \c elisionChanged() signal to the \c setVisible() slot of the \c label, + it will act as an indicator to when the text is elided or not. This signal + could, for instance, be used to make a "More" button visible, or similar. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 2 + + The \c widthSlider and \c heightSlider specify the size of the + \c elidedText. Since the y-axis is inverted, the \c heightSlider has to be + inverted to act appropriately. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 3 + + The components are all stored in a QGridLayout, which is made the layout of + the \c TestWidget. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 4 + + On the Maemo platform, windows are stuck in landscape mode by default. With + this attribute set, the window manager is aware that this window can be + rotated. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 5 + + The \c widthSlider and \c heightSlider have the exact same length as the + dimensions of the \c elidedText. The maximum value for both of them is + thus their lengths, and each tick indicates one pixel. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 6 + + The \c switchText() slot simply cycles through all the available sample + texts. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 7 + + These slots set the width and height of the \c elided text, in response to + changes in the sliders. + + \section1 The \c main() Function + + The \c main() function creates an instance of \c TestWidget fullscreen and + enters the message loop. + + \snippet examples/widgets/elidedlabel/main.cpp 0 +*/ + diff --git a/doc/src/examples/ftp.qdoc b/doc/src/examples/ftp.qdoc index 4fa2cfd..841d298 100644 --- a/doc/src/examples/ftp.qdoc +++ b/doc/src/examples/ftp.qdoc @@ -131,7 +131,9 @@ \snippet examples/network/qftp/ftpwindow.cpp 5 - QFtp supports canceling the download of files. + QFtp supports canceling the download of files. We make sure that + any file that is currently being written to is closed and removed, + and tidy up by deleting the file object. \snippet examples/network/qftp/ftpwindow.cpp 6 diff --git a/doc/src/examples/maemovibration.qdoc b/doc/src/examples/maemovibration.qdoc new file mode 100644 index 0000000..ace84e0 --- /dev/null +++ b/doc/src/examples/maemovibration.qdoc @@ -0,0 +1,164 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in a +** written agreement between you and Nokia. +** +** 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example widgets/maemovibration + \group all-examples + \title Maemo Vibration Example + + The Maemo Vibration example shows how to tell the Maemo Mode Control Entity + (MCE) to vibrate a maemo device. + + The MCE is a system service on Maemo that, among other things, provides an + D-Bus interface to trigger vibrations. The vibrations are specified as + patterns and are defined in a system configuration file. + + The example program reads the configuration file to look for possible + vibration patterns and display a button for each. Pressing a button will + make the device vibrate accordingly, until the application closes, or + another pattern is started. + + \image maemovibration-example.png Screenshot of the Maemo Vibration Example + + The code makes use of two classes: + + \list + \o \c MceVibrator connects to the MCE service and can start a certain + vibrator pattern. It also is responsible to parse the configuration + file. + + \o \c ButtonWidget provides a button for each pattern. Pressing the button + activates the pattern in question. + \endlist + + + \section1 MceVibrator Class Definition + + \snippet examples/widgets/maemovibration/src/mcevibrator.h 0 + + The \c MceVibrator class inherits from QObject and provides a specialized + and Qt friendly interface to the MCE vibration facilty. The slot \c vibrate() + can be called to make the device vibrate according to a specific pattern + name. We will connect it to a signal of a \c ButtonWidget object later. The + static method \c ParsePatternNames() can be called to find out which patterns + are available to us. + + \list + \o \c mceInterface is our D-Bus handle to the MCE service. We use it to + invoke methods on the MCE request object. + + \o \c lastPatternName contains the pattern that was activated last time. We + have to keep track of this, because the last pattern has to be + deactivated before activating a new pattern. + \endlist + + + \section1 MceVibrator Class Implementation + + To connect to the service, we initialize the D-Bus interface handle. The + system header \c "mce/dbus-names.h" contains definitions of the D-Bus + service name and request object path and interface. These are passed to the + constructor of the handle, and Qt will automatically establish a connection + to it, if it is possible. + + The MCE expects us to first enable the vibrator before we can use it. This + is done with the call to the \c MCE_ENABLE_VIBRATOR D-Bus method. + + \snippet examples/widgets/maemovibration/src/mcevibrator.cpp 0 + + From now on we can activate vibration patterns. Each time a vibration + pattern is activated, the last pattern has to be deactivated first. In the + vibrate slot we use the MCE interface to call the activation method. + + \snippet examples/widgets/maemovibration/src/mcevibrator.cpp 1 + + The calls to the private method deactivate simply makes sure to deactivate + the last pattern used, if there was one. + + \snippet examples/widgets/maemovibration/src/mcevibrator.cpp 2 + + Calling either the activate or deactivate MCE D-Bus method with invalid + pattern names are ignored. + + Finally, the destructor disables the vibrator. When the destructor of the + MCE interface handle is called, the connection is also closed. + + \snippet examples/widgets/maemovibration/src/mcevibrator.cpp 3 + + The MCE configuration file contains options for many different things. We + are only interested in one line that contains the vibration patterns. It + has the following format: + + + \code + VibratorPatterns=semicolon;separated;list;of;values + \endcode + + The static method \c ParsePatternNames looks for this line and returns a + QStringList containing the values, which are the pattern names we can use. + + \snippet examples/widgets/maemovibration/src/mcevibrator.cpp 4 + + The helper function \c checkError() saves us some code duplication. None of the + called methods return anything of use to us, so we're only interested in + getting error messages for debugging. + + \snippet examples/widgets/maemovibration/src/mcevibrator.cpp 5 + + + \section1 ButtonWidget Class Definition + + \snippet examples/widgets/maemovibration/src/buttonwidget.h 0 + + The \c ButtonWidget class inherits from QWidget and provides the main user + interface for the application. It creates a grid of buttons, one for each + string in the stringlist passed to the constructor. Pressing a button emits + the \c clicked() signal, where the string is the text of the button that + was pressed. + + This class is taken from the QSignalMapper documentation. The only change + is the number of columns in the grid from three to two, to make the button + labels fit. + + + \section1 ButtonWidget Class Implementation + + \snippet examples/widgets/maemovibration/src/buttonwidget.cpp 0 + + + \section1 \c main() Function + + The main function begins with looking up the patterns available to us. + + \snippet examples/widgets/maemovibration/src/main.cpp 0 + + Then we create one instance of both classes, and connects the + \c ButtonWidget's clicked signal to the \c MceVibrator's \c vibrate() slot. + This works, since the button texts are the same as the pattern names. + + \snippet examples/widgets/maemovibration/src/main.cpp 1 +*/ diff --git a/doc/src/examples/orientation.qdoc b/doc/src/examples/orientation.qdoc new file mode 100644 index 0000000..8b84229 --- /dev/null +++ b/doc/src/examples/orientation.qdoc @@ -0,0 +1,143 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in a +** written agreement between you and Nokia. +** +** 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! \example widgets/orientation + \group all-examples + \title Orientation Example + + The example shows a simple way to use different UIs depending on the screen + orientation of a mobile device. + + \image orientation-landscape.png The UI in landscape mode + \image orientation-portrait.png The UI in portrait mode + + The screen on many mobile devices can be viewed in both portrait and + landscape orientation. The orientation can be swiched with the help of a + hardware or software trigger. Due to the often small physical screen size, + user interfaces has to be very simple and compact to stay usable, and + applications usually occupy the whole screen. Designing a user interface + that works equally well in both landscape and portrait mode is not always + possible, however, so making a different layout for each case usually pays + off. + + The example application makes use of two different UI widgets created with + the Qt Designer, one for portrait and one for landscape orientation. The + application has a widget that contains an image and the user is able to + select one of three images for it to show. In addition to the two UIs, the + application consists of a \c MainWindow class. + + \section1 Landscape UI + + If the screen is in landscape mode, the user probably holds the device with + both hands and is ready to give full attention to the application. The + landscape UI looks like this: + + \image orientation-landscape-ui.png The landscape UI + + To the left is a QWidget called \c choiceWidget, which will show the + current image, and to the right are three QRadioButton instances. The + active radio button specifies the image to show. + + \section1 Portrait UI + + When the device is in portrait mode, it usually means that the user holds + it with one hand, and can comfortably use the thumb for small amounts of + input. The layout is simpler, and is focused on consuming content. The + portrait UI looks like this: + + \image orientation-portrait-ui.png The portrait UI + + Similarly, it contains a QWidget, also called \c choiceWidget, that will + show the current image. In contrast to the landscape UI, this one doesn't + provide any controls to change the image. + + \section1 MainWindow Class Definition + + \c MainWindow inherits from QWidget and acts as the top level widget of the + application. + + \snippet examples/widgets/orientation/mainwindow.h 0 + + The \c resizeEvent() method is re-implemented, and used to check which + UI to show. The \c onRadioButtonClicked() slot is connected to the + landscape UI's radio button group and selects the current image. + + \c landscapeWidget and \c portraitWidget will contain the UI layouts. Only + one of them is visible at a time. + + \section1 MainWindow Class Implementation + + In the constructor, the widgets that will hold the UIs are created and set + up. + + \snippet examples/widgets/orientation/mainwindow.cpp 0 + + Since the exit buttons on the layouts are different from each other, both + of them have to have their \c clicked() signal connected to the \c close() + slot of the main widget. The first image is also made current with the call + to \c onRadioButtonClicked(). + + \snippet examples/widgets/orientation/mainwindow.cpp 1 + + On the Maemo platform, windows are stuck in landscape mode by default. The + application has to explicitly say that rotation is supported. + + \snippet examples/widgets/orientation/mainwindow.cpp 2 + + The \c resizeEvent() is called when the main window is first created, and + also whenever the window has been resized. If the window is shown in + full screen, this is an indication that the orientation of the screen has + changed. + + The dimensions of \c landscapeWidget is the transpose of the dimensions of + \c portraitWidget. When the orientation is known, both are set to the + (possibly transposed) size of the window. Depending on the orientation, one + widget is made visible and the other invisible. + + \snippet examples/widgets/orientation/mainwindow.cpp 3 + + When the user selects one of the radio buttons in the landscape UI, the + current image is changed. The image is displayed by specifying the + background style of the choice widget. Since both \c portrait and + \c landscape have a \c choiceWidget of their own, the change has to be + reflected in both instances. + + \snippet examples/widgets/orientation/mainwindow.cpp 4 + + Synchronizing both UIs like this might become unfeasible when there are + many things that can change. In that case it is better to make use of the + \l{An Introduction to Model/View Programming}{Model-View-Controller pattern} + more extensively and share the content between both portrait and landscape + widgets. Then an interface for displaying and manipulating it can be tailor + made for both orientations. + + \section1 The \c main() Function + + The main function creates a \c MainWindow instance and shows it full + screen. + \snippet examples/widgets/orientation/main.cpp 0 +*/ diff --git a/doc/src/examples/portedasteroids.qdoc b/doc/src/examples/portedasteroids.qdoc index ed622e6..ad34fa7 100644 --- a/doc/src/examples/portedasteroids.qdoc +++ b/doc/src/examples/portedasteroids.qdoc @@ -29,8 +29,9 @@ \example graphicsview/portedasteroids \title Ported Asteroids Example - This GraphicsView example is a port of the - Asteroids game, which was based on QCanvas. + The Ported Asteroids example is a port of the + Asteroids game, which was based on QCanvas, to the Graphics View + framework. \image portedasteroids-example.png */ diff --git a/doc/src/examples/portedcanvas.qdoc b/doc/src/examples/portedcanvas.qdoc index 3363a2d..1799673 100644 --- a/doc/src/examples/portedcanvas.qdoc +++ b/doc/src/examples/portedcanvas.qdoc @@ -29,8 +29,8 @@ \example graphicsview/portedcanvas \title Ported Canvas Example - This GraphicsView example is a port of the old - QCanvas example from Qt 3. + The Ported Canvas example is a port of the old + QCanvas example from Qt 3 to the Graphics View framework. \sa {Porting to Graphics View} diff --git a/doc/src/examples/recipes.qdoc b/doc/src/examples/recipes.qdoc index f34fe3b..8e9619a 100644 --- a/doc/src/examples/recipes.qdoc +++ b/doc/src/examples/recipes.qdoc @@ -29,7 +29,7 @@ \example xmlpatterns/recipes \title Recipes Example - The recipes example shows how to use QtXmlPatterns to query XML data + The Recipes example shows how to use QtXmlPatterns to query XML data loaded from a file. \tableofcontents diff --git a/doc/src/examples/rsslisting.qdoc b/doc/src/examples/rsslisting.qdoc index ca29c04..6bef665 100644 --- a/doc/src/examples/rsslisting.qdoc +++ b/doc/src/examples/rsslisting.qdoc @@ -29,7 +29,7 @@ \example xml/rsslisting \title RSS-Listing Example - This example shows how to create a widget that displays news items + The RSS-Listing example shows how to create a widget that displays news items from RDF news sources. \image rsslistingexample.png diff --git a/doc/src/examples/schema.qdoc b/doc/src/examples/schema.qdoc index 1cc4ed3..3fab7d6 100644 --- a/doc/src/examples/schema.qdoc +++ b/doc/src/examples/schema.qdoc @@ -29,8 +29,8 @@ \example xmlpatterns/schema \title XML Schema Validation Example - This example shows how to use QtXmlPatterns to validate XML with - a W3C XML Schema. + The XML Schema Validation example shows how to use QtXmlPatterns to + validate XML with a W3C XML Schema. \tableofcontents diff --git a/doc/src/examples/symbianvibration.qdoc b/doc/src/examples/symbianvibration.qdoc new file mode 100644 index 0000000..a0de236 --- /dev/null +++ b/doc/src/examples/symbianvibration.qdoc @@ -0,0 +1,192 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in a +** written agreement between you and Nokia. +** +** 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! \example widgets/symbianvibration + \group all-examples + \title Symbian Vibration Example + + The Symbian Vibrator example shows how to get fine-grained vibration + control on Symbian devices. + + Native Symbian APIs have to be used to enable vibration, since QtMobility + doesn't provide an interface for it yet. It is, however, planned to be + included in a future release. In anticipation for that, we make use of the + \c XQVibra class that was a part of the Mobile Extensions Technology Preview + API for Qt for Symbian. The pre-compiled libraries are no longer compatible + with Qt 4.6, but we can include the source code itself with the project. + + \image symbianvibration-example.png Screenshot of the Symbian Vibration example + + The example application divides the window into rectangles, which can be + pressed to make the device vibrate. Pressing different rectangles make the + device vibrate with different intensities. Each rectangle has a different + color and its intensity number is drawn on top of it. Moving the cursor + from one rectangle to another changes the vibration intensity to that of + the new one. Vibration stops when the mouse button has been released. It + is also possible to launch a short burst of vibration through the menu. + + The example consists of four classes: + + \list + \o \c XQVibra is the vibration interface class taken from the Mobile + Extensions for Qt for Symbian. + + \o \c XQVibraPrivate is the Symbian specific private implementation of the + vibration implementation. + + \o \c VibrationSurface is a custom widget that uses a XQVibra instance to + vibrate the device depending on where the user presses. + + \o \c MainWindow inherits from QMainWindow and contains a \c VibrationSurface + as its central widget, and also has a menu from which it is possible to + make the phone vibrate. + \endlist + + \section1 XQVibra Class Definition + + The \c XQVibra class uses the pimpl-idiom to hide the platform specific + implementation behind a common interface. Technically it would be possible + to support more target platforms, with only the addition of a private + implementation. The rest of the code would work the same, since only the + common interface is used. + + \snippet examples/widgets/symbianvibration/xqvibra.h 0 + + \c XQVibra provides a very simple interface for us to use. The interesting + part are the three slots \c start(), \c stop() and \c setIntensity(). Calling the start + method initiates vibration for the specified duration. Calling it while the + device is already vibrating causes it to stop the current one and start the + new one, even if the intensities are the same. The \c setIntensity() method + should be called before starting vibration. + + + \section1 VibrationSurface Class Definition + + \c VibrationSurface inherits from QWidget and acts like a controller for a + \c XQVibra object. It responds to mouse events and performs custom painting. + + \snippet examples/widgets/symbianvibration/vibrationsurface.h 0 + + The virtual event methods are reimplemented from QWidget. As can be seen, + there is no public programmable interface beyond what QWidget provides. + + + \section1 VibrationSurface Class Implementation + + Mouse events control the intensity of the vibration. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 0 + \codeline + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 1 + \codeline + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 2 + + Presses starts the vibration, movement changes the intensity and releases + stops the vibration. To set the right amount of vibration, the private + method \c applyIntensity() is used. It sets the vibration intensity according to + which rectangle the mouse currently resides in. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 3 + + We make sure only to change the intensity if it is different than last + time, so that the vibrator isn't stopped and restarted unnecessarily. + + The range of vibration intensity ranges from 0 to XQVibra::MaxIntensity. We + divide this range into a set of levels. The number of levels and the intensity + increase for each level are stored in two constants. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 4 + + Each rectangle has an intensity of one \c IntensityPerLevel more than the + previous one. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 5 + + The rectangles are either put in a row, if the widget's width is greater + than its height (landscape), otherwise they are put in a column (portrait). + Each rectangle's size is thus dependent on the length of the width or the + height of the widget, whichever is longer. The length is then divided by + the number of levels, which gets us either the height or the width of each + rectangle. The dx and dy specify the distance from one rectangle to the + next, which is the same as either the width or height of the rectangle. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 6 + + For each level of intensity, we draw a rectangle with increasing + brightness. On top of the rectangle a text label is drawn, specifying the + intesity of this level. We use the rectangle rect as a template for + drawing, and move it down or right at each iteration. + + The intensity is calculated by dividing the greater of the width and height + into \c NumberOfLevels slices. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 7 + + In case the widget's geometry is too small to fit all the levels, the user + interface will not work. For simplicity, we just return 0. + + When we know the axis along which the rectangles lie, we can find the one + in which the mouse cursor lie. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 8 + + The final clamp of the intensity value at the end is necessary in case the + mouse coordinate lies outside the widget's geometry. + + + \section1 MainWindow Class Definition + + Here's the definition of the \c MainWindow class: + + \snippet examples/widgets/symbianvibration/mainwindow.h 0 + + \c MainWindow is a top level window that uses a \c XQVibra and a + \c VibrationSurface. It also adds a menu option to the menu bar which can + start a short vibration. + + \section1 MainWindow Class Implementation + + In the \c MainWindow constructor the \c XQVibra and the \c VibrationSurface + are created. An action is added to the menu and is connected to the vibrate + slot. + + \snippet examples/widgets/symbianvibration/mainwindow.cpp 0 + + The \c vibrate() slot offers a way to invoke the vibration in case no + mouse is present on the device. + + \snippet examples/widgets/symbianvibration/mainwindow.cpp 1 + + \section1 Symbian Vibration Library + + The \c XQVibra class requires a platform library to be included. It is + included in the \c .pro file for the symbian target. + + \quotefromfile examples/widgets/symbianvibration/symbianvibration.pro + \skipto /^symbian \{/ + \printuntil /^\}/ +*/ diff --git a/doc/src/images/appicon_packagecontents.png b/doc/src/images/appicon_packagecontents.png new file mode 100644 index 0000000..49cb1e4 Binary files /dev/null and b/doc/src/images/appicon_packagecontents.png differ diff --git a/doc/src/images/appicon_screenshot.png b/doc/src/images/appicon_screenshot.png new file mode 100644 index 0000000..c29dd11 Binary files /dev/null and b/doc/src/images/appicon_screenshot.png differ diff --git a/doc/src/images/cube.png b/doc/src/images/cube.png new file mode 100644 index 0000000..95dfc98 Binary files /dev/null and b/doc/src/images/cube.png differ diff --git a/doc/src/images/cube_faces.png b/doc/src/images/cube_faces.png new file mode 100644 index 0000000..2c7102a Binary files /dev/null and b/doc/src/images/cube_faces.png differ diff --git a/doc/src/images/elidedlabel-example.png b/doc/src/images/elidedlabel-example.png new file mode 100644 index 0000000..741d289 Binary files /dev/null and b/doc/src/images/elidedlabel-example.png differ diff --git a/doc/src/images/maemovibration-example.png b/doc/src/images/maemovibration-example.png new file mode 100644 index 0000000..be975fc Binary files /dev/null and b/doc/src/images/maemovibration-example.png differ diff --git a/doc/src/images/orientation-landscape-ui.png b/doc/src/images/orientation-landscape-ui.png new file mode 100644 index 0000000..c591ff1 Binary files /dev/null and b/doc/src/images/orientation-landscape-ui.png differ diff --git a/doc/src/images/orientation-landscape.png b/doc/src/images/orientation-landscape.png new file mode 100644 index 0000000..e606804 Binary files /dev/null and b/doc/src/images/orientation-landscape.png differ diff --git a/doc/src/images/orientation-portrait-ui.png b/doc/src/images/orientation-portrait-ui.png new file mode 100644 index 0000000..304835b Binary files /dev/null and b/doc/src/images/orientation-portrait-ui.png differ diff --git a/doc/src/images/orientation-portrait.png b/doc/src/images/orientation-portrait.png new file mode 100644 index 0000000..3d778e8 Binary files /dev/null and b/doc/src/images/orientation-portrait.png differ diff --git a/doc/src/images/qml-listview-snippet.png b/doc/src/images/qml-listview-snippet.png new file mode 100644 index 0000000..0ee0ffc Binary files /dev/null and b/doc/src/images/qml-listview-snippet.png differ diff --git a/doc/src/images/symbianvibration-example.png b/doc/src/images/symbianvibration-example.png new file mode 100644 index 0000000..21461b6 Binary files /dev/null and b/doc/src/images/symbianvibration-example.png differ diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc index 58a7e69..c033a5f 100644 --- a/doc/src/platforms/symbian-introduction.qdoc +++ b/doc/src/platforms/symbian-introduction.qdoc @@ -152,9 +152,9 @@ when application \c .sis needs to be separately signed before including it into smart installer \c .sis. \row \o \c unsigned_installer_sis \o Create unsigned \l{Smart Installer}{smart installer} - \c .sis file for project. - Note: The application \c .sis contained in smart installer - \c .sis will also be unsigned. + \c .sis file for project. + Note: The application \c .sis contained in smart installer + \c .sis will also be unsigned. \row \o \c stub_sis \o Create a stub sis to allow upgradability of projects that are deployed in ROM \endtable 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 0000000..62a444d --- /dev/null +++ b/doc/src/snippets/declarative/grid/grid-items.qml @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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 0000000..a6ca305 --- /dev/null +++ b/doc/src/snippets/declarative/grid/grid-no-spacing.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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 0000000..c03cdad --- /dev/null +++ b/doc/src/snippets/declarative/grid/grid-spacing.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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/listview/listview-snippet.qml b/doc/src/snippets/declarative/listview/listview-snippet.qml new file mode 100644 index 0000000..f2a260d --- /dev/null +++ b/doc/src/snippets/declarative/listview/listview-snippet.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** 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/mousearea/mousearea-snippet.qml b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml index 03473ba..1b9a9ec 100644 --- a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml +++ b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml @@ -47,53 +47,53 @@ Rectangle { width: 500; height: 500 color: "green" -Column { -//! [anchor fill] -Rectangle { - id: button - width: 100; height: 100 + 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] + 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 + 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] -} + //! [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 + 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] -} + //! [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 + } //end of column //! [parent end] } //! [parent end] 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 0000000..8c018be --- /dev/null +++ b/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg @@ -0,0 +1,104 @@ + + + + + + image/svg+xml + + + + + + SVG generated by Lineform + + + + + + + + + + + + + + + diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h b/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h index f317d40..763a451 100644 --- a/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h +++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc index efd0ff2..ed08252 100644 --- a/doc/src/tutorials/modelview.qdoc +++ b/doc/src/tutorials/modelview.qdoc @@ -104,7 +104,6 @@ array of the data elements that the user can change. The table widget can be integrated into a program flow by reading and writing the data elements that the table widget provides. - This method is very intuitive and useful in many applications, but displaying and editing a database table with a standard table widget can be problematic. Two copies of the data have to be coordinated: one outside the diff --git a/examples/animation/animatedtiles/animatedtiles.desktop b/examples/animation/animatedtiles/animatedtiles.desktop new file mode 100644 index 0000000..97e646f --- /dev/null +++ b/examples/animation/animatedtiles/animatedtiles.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Animated Tiles +Exec=/opt/usr/bin/animatedtiles +Icon=animatedtiles +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/animatedtiles/animatedtiles.pro b/examples/animation/animatedtiles/animatedtiles.pro index d700642..17528b7 100644 --- a/examples/animation/animatedtiles/animatedtiles.pro +++ b/examples/animation/animatedtiles/animatedtiles.pro @@ -11,3 +11,4 @@ symbian { TARGET.UID3 = 0xA000D7D1 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/animatedtiles/main.cpp b/examples/animation/animatedtiles/main.cpp index 1badb4f..46b5d1d 100644 --- a/examples/animation/animatedtiles/main.cpp +++ b/examples/animation/animatedtiles/main.cpp @@ -210,7 +210,11 @@ int main(int argc, char **argv) view->setBackgroundBrush(bgPix); view->setCacheMode(QGraphicsView::CacheBackground); view->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); +#ifdef Q_OS_SYMBIAN + view->showMaximized(); +#else view->show(); +#endif QStateMachine states; states.addState(rootState); diff --git a/examples/animation/appchooser/appchooser.desktop b/examples/animation/appchooser/appchooser.desktop new file mode 100644 index 0000000..8e413e9 --- /dev/null +++ b/examples/animation/appchooser/appchooser.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Application Chooser +Exec=/opt/usr/bin/appchooser +Icon=appchooser +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/appchooser/appchooser.pro b/examples/animation/appchooser/appchooser.pro index 7d45da2..8355c6f 100644 --- a/examples/animation/appchooser/appchooser.pro +++ b/examples/animation/appchooser/appchooser.pro @@ -11,3 +11,4 @@ symbian { TARGET.UID3 = 0xA000E3F5 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/appchooser/main.cpp b/examples/animation/appchooser/main.cpp index 86ec073..3788533 100644 --- a/examples/animation/appchooser/main.cpp +++ b/examples/animation/appchooser/main.cpp @@ -80,6 +80,21 @@ private: QPixmap p; }; +class GraphicsView : public QGraphicsView +{ + Q_OBJECT +public: + GraphicsView(QGraphicsScene *scene, QWidget *parent = 0) : QGraphicsView(scene, parent) + { + } + + virtual void resizeEvent(QResizeEvent *event) + { + fitInView(sceneRect(), Qt::KeepAspectRatio); + } +}; + + void createStates(const QObjectList &objects, const QRect &selectedRect, QState *parent) { @@ -112,10 +127,10 @@ int main(int argc, char **argv) p3->setObjectName("p3"); p4->setObjectName("p4"); - p1->setGeometry(QRectF(0.0, 0.0, 64.0, 64.0)); - p2->setGeometry(QRectF(236.0, 0.0, 64.0, 64.0)); + p1->setGeometry(QRectF( 0.0, 0.0, 64.0, 64.0)); + p2->setGeometry(QRectF(236.0, 0.0, 64.0, 64.0)); p3->setGeometry(QRectF(236.0, 236.0, 64.0, 64.0)); - p4->setGeometry(QRectF(0.0, 236.0, 64.0, 64.0)); + p4->setGeometry(QRectF( 0.0, 236.0, 64.0, 64.0)); QGraphicsScene scene(0, 0, 300, 300); scene.setBackgroundBrush(Qt::white); @@ -124,7 +139,7 @@ int main(int argc, char **argv) scene.addItem(p3); scene.addItem(p4); - QGraphicsView window(&scene); + GraphicsView window(&scene); window.setFrameStyle(0); window.setAlignment(Qt::AlignLeft | Qt::AlignTop); window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -135,12 +150,13 @@ int main(int argc, char **argv) QState *group = new QState(&machine); group->setObjectName("group"); + QRect selectedRect(86, 86, 128, 128); QState *idleState = new QState(group); group->setInitialState(idleState); - QObjectList objects; + QObjectList objects; objects << p1 << p2 << p3 << p4; createStates(objects, selectedRect, group); createAnimations(objects, &machine); @@ -148,8 +164,12 @@ int main(int argc, char **argv) machine.setInitialState(group); machine.start(); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + window.showMaximized(); +#else window.resize(300, 300); window.show(); +#endif return app.exec(); } diff --git a/examples/animation/easing/easing.desktop b/examples/animation/easing/easing.desktop new file mode 100644 index 0000000..56d1222 --- /dev/null +++ b/examples/animation/easing/easing.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Easing Curves +Exec=/opt/usr/bin/easing +Icon=easing +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/easing/easing.pro b/examples/animation/easing/easing.pro index a8eda70..763a680 100644 --- a/examples/animation/easing/easing.pro +++ b/examples/animation/easing/easing.pro @@ -5,15 +5,18 @@ SOURCES = main.cpp \ FORMS = form.ui -RESOURCES = easing.qrc +RESOURCES = easing.qrc -# install target.path = $$[QT_INSTALL_EXAMPLES]/animation/easing sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS easing.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/animation/easing -INSTALLS += target sources +INSTALLS += sources + +INSTALLS += target symbian { TARGET.UID3 = 0xA000E3F6 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) } + +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/easing/form.ui b/examples/animation/easing/form.ui index b60ade8..364aebe 100644 --- a/examples/animation/easing/form.ui +++ b/examples/animation/easing/form.ui @@ -49,12 +49,27 @@ + + + 16777215 + 16777215 + + Path type - - + + + + + 16777215 + 40 + + + + Qt::LeftToRight + Line @@ -66,8 +81,14 @@ - + + + + 16777215 + 40 + + Circle @@ -96,6 +117,18 @@ + + + 0 + 0 + + + + + 0 + 30 + + Period @@ -106,6 +139,18 @@ false + + + 0 + 0 + + + + + 0 + 30 + + -1.000000000000000 @@ -117,18 +162,17 @@ - - - - Amplitude - - - - + false + + + 0 + 30 + + -1.000000000000000 @@ -140,18 +184,30 @@ - + + + + 0 + 30 + + Overshoot - + false + + + 0 + 30 + + -1.000000000000000 @@ -163,6 +219,19 @@ + + + + + 0 + 30 + + + + Amplitude + + + diff --git a/examples/animation/easing/main.cpp b/examples/animation/easing/main.cpp index def1db2..66a6958 100644 --- a/examples/animation/easing/main.cpp +++ b/examples/animation/easing/main.cpp @@ -46,7 +46,15 @@ int main(int argc, char **argv) Q_INIT_RESOURCE(easing); QApplication app(argc, argv); Window w; + +#if defined(Q_OS_SYMBIAN) + w.showMaximized(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + w.show(); +#else w.resize(400, 400); w.show(); +#endif + return app.exec(); } diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp index b466cec..869bca4 100644 --- a/examples/animation/easing/window.cpp +++ b/examples/animation/easing/window.cpp @@ -41,7 +41,12 @@ #include "window.h" Window::Window(QWidget *parent) - : QWidget(parent), m_iconSize(64, 64) + : QWidget(parent), +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + m_iconSize(32, 32) +#else + m_iconSize(64, 64) +#endif { m_ui.setupUi(this); QButtonGroup *buttonGroup = findChild(); // ### workaround for uic in 4.4 diff --git a/examples/animation/easing/window.h b/examples/animation/easing/window.h index bbdf14e..17899a4 100644 --- a/examples/animation/easing/window.h +++ b/examples/animation/easing/window.h @@ -39,7 +39,6 @@ ****************************************************************************/ #include - #include "ui_form.h" #include "animation.h" @@ -73,6 +72,4 @@ private: PixmapItem *m_item; Animation *m_anim; QSize m_iconSize; - - }; diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp index 3194c1b..ca1876f 100644 --- a/examples/animation/moveblocks/main.cpp +++ b/examples/animation/moveblocks/main.cpp @@ -154,25 +154,28 @@ QState *createGeometryState(QObject *w1, const QRect &rect1, } //![13] + +class GraphicsView : public QGraphicsView +{ + Q_OBJECT +public: + GraphicsView(QGraphicsScene *scene, QWidget *parent = NULL) : QGraphicsView(scene, parent) + { + } + +protected: + virtual void resizeEvent(QResizeEvent *event) + { + fitInView(scene()->sceneRect()); + QGraphicsView::resizeEvent(event); + } +}; + + int main(int argc, char **argv) { QApplication app(argc, argv); -#if 0 - QWidget window; - QPalette palette; - palette.setBrush(QPalette::Window, Qt::black); - window.setPalette(palette); - QPushButton *button1 = new QPushButton("A", &window); - QPushButton *button2 = new QPushButton("B", &window); - QPushButton *button3 = new QPushButton("C", &window); - QPushButton *button4 = new QPushButton("D", &window); - - button1->setObjectName("button1"); - button2->setObjectName("button2"); - button3->setObjectName("button3"); - button4->setObjectName("button4"); -#else //![1] QGraphicsRectWidget *button1 = new QGraphicsRectWidget; QGraphicsRectWidget *button2 = new QGraphicsRectWidget; @@ -188,12 +191,11 @@ int main(int argc, char **argv) scene.addItem(button3); scene.addItem(button4); //![1] - QGraphicsView window(&scene); + GraphicsView window(&scene); window.setFrameStyle(0); window.setAlignment(Qt::AlignLeft | Qt::AlignTop); window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); window.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); -#endif //![2] QStateMachine machine; @@ -308,8 +310,13 @@ int main(int argc, char **argv) machine.start(); //![9] +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + window.showMaximized(); + window.fitInView(scene.sceneRect() ); +#else window.resize(300, 300); window.show(); +#endif qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); diff --git a/examples/animation/moveblocks/moveblocks.desktop b/examples/animation/moveblocks/moveblocks.desktop new file mode 100644 index 0000000..4100f44 --- /dev/null +++ b/examples/animation/moveblocks/moveblocks.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Move Blocks +Exec=/opt/usr/bin/moveblocks +Icon=moveblocks +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/moveblocks/moveblocks.pro b/examples/animation/moveblocks/moveblocks.pro index 0a32ecf..ad83ba0 100644 --- a/examples/animation/moveblocks/moveblocks.pro +++ b/examples/animation/moveblocks/moveblocks.pro @@ -10,3 +10,4 @@ symbian { TARGET.UID3 = 0xA000E3F7 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp index 1565489..d49aa41 100644 --- a/examples/animation/states/main.cpp +++ b/examples/animation/states/main.cpp @@ -62,6 +62,19 @@ private: QPixmap p; }; +class GraphicsView : public QGraphicsView +{ +public: + GraphicsView(QGraphicsScene *scene) : QGraphicsView(scene) + { + } + + virtual void resizeEvent(QResizeEvent *event) + { + fitInView(sceneRect(), Qt::KeepAspectRatio); + } +}; + int main(int argc, char *argv[]) { Q_INIT_RESOURCE(states); @@ -130,12 +143,12 @@ int main(int argc, char *argv[]) state1->assignProperty(button, "text", "Switch to state 2"); state1->assignProperty(widget, "geometry", QRectF(0, 0, 400, 150)); state1->assignProperty(box, "geometry", QRect(-200, 150, 200, 150)); - state1->assignProperty(p1, "pos", QPointF(68, 185)); - state1->assignProperty(p2, "pos", QPointF(168, 185)); - state1->assignProperty(p3, "pos", QPointF(268, 185)); - state1->assignProperty(p4, "pos", QPointF(68-150, 48-150)); - state1->assignProperty(p5, "pos", QPointF(168, 48-150)); - state1->assignProperty(p6, "pos", QPointF(268+150, 48-150)); + state1->assignProperty(p1, "pos", QPointF(68, 200)); // 185)); + state1->assignProperty(p2, "pos", QPointF(168, 200)); // 185)); + state1->assignProperty(p3, "pos", QPointF(268, 200)); // 185)); + state1->assignProperty(p4, "pos", QPointF(68 - 150, 48 - 150)); + state1->assignProperty(p5, "pos", QPointF(168, 48 - 150)); + state1->assignProperty(p6, "pos", QPointF(268 + 150, 48 - 150)); state1->assignProperty(p1, "rotation", qreal(0)); state1->assignProperty(p2, "rotation", qreal(0)); state1->assignProperty(p3, "rotation", qreal(0)); @@ -154,9 +167,9 @@ int main(int argc, char *argv[]) state2->assignProperty(button, "text", "Switch to state 3"); state2->assignProperty(widget, "geometry", QRectF(200, 150, 200, 150)); state2->assignProperty(box, "geometry", QRect(9, 150, 190, 150)); - state2->assignProperty(p1, "pos", QPointF(68-150, 185+150)); - state2->assignProperty(p2, "pos", QPointF(168, 185+150)); - state2->assignProperty(p3, "pos", QPointF(268+150, 185+150)); + state2->assignProperty(p1, "pos", QPointF(68 - 150, 185 + 150)); + state2->assignProperty(p2, "pos", QPointF(168, 185 + 150)); + state2->assignProperty(p3, "pos", QPointF(268 + 150, 185 + 150)); state2->assignProperty(p4, "pos", QPointF(64, 48)); state2->assignProperty(p5, "pos", QPointF(168, 48)); state2->assignProperty(p6, "pos", QPointF(268, 48)); @@ -262,8 +275,13 @@ int main(int argc, char *argv[]) machine.start(); - QGraphicsView view(&scene); + GraphicsView view(&scene); + +#if defined(Q_OS_SYMBIAN) + view.showMaximized(); +#else view.show(); +#endif return app.exec(); } diff --git a/examples/animation/states/states.desktop b/examples/animation/states/states.desktop new file mode 100644 index 0000000..8429979 --- /dev/null +++ b/examples/animation/states/states.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=States +Exec=/opt/usr/bin/states +Icon=states +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/states/states.pro b/examples/animation/states/states.pro index 9d9a9c1..307e098 100644 --- a/examples/animation/states/states.pro +++ b/examples/animation/states/states.pro @@ -11,3 +11,4 @@ symbian { TARGET.UID3 = 0xA000E3F8 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/animation/stickman/graphicsview.cpp b/examples/animation/stickman/graphicsview.cpp index 23036ef..0f7ce5f 100644 --- a/examples/animation/stickman/graphicsview.cpp +++ b/examples/animation/stickman/graphicsview.cpp @@ -54,4 +54,7 @@ void GraphicsView::keyPressEvent(QKeyEvent *e) emit keyPressed(Qt::Key(e->key())); } - +void GraphicsView::resizeEvent(QResizeEvent *event) +{ + fitInView(scene()->sceneRect()); +} diff --git a/examples/animation/stickman/graphicsview.h b/examples/animation/stickman/graphicsview.h index 9cf87b6..400e4a6 100644 --- a/examples/animation/stickman/graphicsview.h +++ b/examples/animation/stickman/graphicsview.h @@ -51,6 +51,7 @@ public: GraphicsView(QWidget *parent = 0); protected: + virtual void resizeEvent(QResizeEvent *event); void keyPressEvent(QKeyEvent *); signals: diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp index 4abcdc2..8e9dbe1 100644 --- a/examples/animation/stickman/lifecycle.cpp +++ b/examples/animation/stickman/lifecycle.cpp @@ -159,10 +159,14 @@ void LifeCycle::start() m_machine->start(); } -void LifeCycle::addActivity(const QString &fileName, Qt::Key key) +void LifeCycle::addActivity(const QString &fileName, Qt::Key key, QObject *sender, const char *signal) { QState *state = makeState(m_alive, fileName); m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state)); + + if((sender != NULL) || (signal != NULL)) { + m_alive->addTransition(sender, signal, state); + } } QState *LifeCycle::makeState(QState *parentState, const QString &animationFileName) diff --git a/examples/animation/stickman/lifecycle.h b/examples/animation/stickman/lifecycle.h index 1bf3661..ca1a052 100644 --- a/examples/animation/stickman/lifecycle.h +++ b/examples/animation/stickman/lifecycle.h @@ -50,6 +50,7 @@ class QAnimationGroup; class QState; class QAbstractState; class QAbstractTransition; +class QObject; QT_END_NAMESPACE class GraphicsView; class LifeCycle @@ -59,7 +60,7 @@ public: ~LifeCycle(); void setDeathAnimation(const QString &fileName); - void addActivity(const QString &fileName, Qt::Key key); + void addActivity(const QString &fileName, Qt::Key key, QObject *sender = NULL, const char *signal = NULL); void start(); diff --git a/examples/animation/stickman/main.cpp b/examples/animation/stickman/main.cpp index 08df766..902e572 100644 --- a/examples/animation/stickman/main.cpp +++ b/examples/animation/stickman/main.cpp @@ -43,6 +43,7 @@ #include "lifecycle.h" #include "stickman.h" #include "graphicsview.h" +#include "rectbutton.h" #include #include @@ -55,6 +56,11 @@ int main(int argc, char **argv) StickMan *stickMan = new StickMan; stickMan->setDrawSticks(false); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + RectButton *buttonJump = new RectButton("Jump"); buttonJump->setPos(100, 125); + RectButton *buttonDance = new RectButton("Dance"); buttonDance->setPos(100, 200); + RectButton *buttonChill = new RectButton("Chill"); buttonChill->setPos(100, 275); +#else QGraphicsTextItem *textItem = new QGraphicsTextItem(); textItem->setHtml("Stickman" "

" @@ -71,31 +77,55 @@ int main(int argc, char **argv) qreal w = textItem->boundingRect().width(); QRectF stickManBoundingRect = stickMan->mapToScene(stickMan->boundingRect()).boundingRect(); textItem->setPos(-w / 2.0, stickManBoundingRect.bottom() + 25.0); +#endif QGraphicsScene scene; scene.addItem(stickMan); + +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + scene.addItem(buttonJump); + scene.addItem(buttonDance); + scene.addItem(buttonChill); +#else scene.addItem(textItem); +#endif scene.setBackgroundBrush(Qt::black); GraphicsView view; view.setRenderHints(QPainter::Antialiasing); view.setTransformationAnchor(QGraphicsView::NoAnchor); view.setScene(&scene); - view.show(); - view.setFocus(); QRectF sceneRect = scene.sceneRect(); // making enough room in the scene for stickman to jump and die view.resize(sceneRect.width() + 100, sceneRect.height() + 100); view.setSceneRect(sceneRect); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + view.showMaximized(); + view.fitInView(scene.sceneRect(), Qt::KeepAspectRatio); +#else + view.show(); + view.setFocus(); +#endif + LifeCycle cycle(stickMan, &view); cycle.setDeathAnimation(":/animations/dead"); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + cycle.addActivity(":/animations/jumping", Qt::Key_J, buttonJump, SIGNAL(clicked())); + cycle.addActivity(":/animations/dancing", Qt::Key_D, buttonDance, SIGNAL(clicked())); + cycle.addActivity(":/animations/chilling", Qt::Key_C, buttonChill, SIGNAL(clicked())); +#else cycle.addActivity(":/animations/jumping", Qt::Key_J); cycle.addActivity(":/animations/dancing", Qt::Key_D); cycle.addActivity(":/animations/chilling", Qt::Key_C); +#endif + cycle.start(); + return app.exec(); } diff --git a/examples/animation/stickman/rectbutton.cpp b/examples/animation/stickman/rectbutton.cpp new file mode 100644 index 0000000..f8b00da --- /dev/null +++ b/examples/animation/stickman/rectbutton.cpp @@ -0,0 +1,33 @@ +#include "rectbutton.h" +#include + +RectButton::RectButton(QString buttonText) : m_ButtonText(buttonText) +{ +} + + +RectButton::~RectButton() +{ +} + + +void RectButton::mousePressEvent (QGraphicsSceneMouseEvent *event) +{ + emit clicked(); +} + + +QRectF RectButton::boundingRect() const +{ + return QRectF(0.0, 0.0, 90.0, 40.0); +} + + +void RectButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + painter->setBrush(Qt::gray); + painter->drawRoundedRect(boundingRect(), 5, 5); + + painter->setPen(Qt::white); + painter->drawText(20, 25, m_ButtonText); +} diff --git a/examples/animation/stickman/rectbutton.h b/examples/animation/stickman/rectbutton.h new file mode 100644 index 0000000..95ca2e2 --- /dev/null +++ b/examples/animation/stickman/rectbutton.h @@ -0,0 +1,25 @@ +#ifndef RECTBUTTON_H +#define RECTBUTTON_H + +#include + +class RectButton : public QGraphicsObject +{ + Q_OBJECT +public: + RectButton(QString buttonText); + ~RectButton(); + + virtual QRectF boundingRect() const; + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + +protected: + QString m_ButtonText; + + virtual void mousePressEvent (QGraphicsSceneMouseEvent *event); + +signals: + void clicked(); +}; + +#endif // RECTBUTTON_H diff --git a/examples/animation/stickman/stickman.desktop b/examples/animation/stickman/stickman.desktop new file mode 100644 index 0000000..1722d4d --- /dev/null +++ b/examples/animation/stickman/stickman.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Stickman +Exec=/opt/usr/bin/stickman +Icon=stickman +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro index 37ff8d3..db0c4e5 100644 --- a/examples/animation/stickman/stickman.pro +++ b/examples/animation/stickman/stickman.pro @@ -2,13 +2,15 @@ HEADERS += stickman.h \ animation.h \ node.h \ lifecycle.h \ - graphicsview.h + graphicsview.h \ + rectbutton.h SOURCES += main.cpp \ stickman.cpp \ animation.cpp \ node.cpp \ lifecycle.cpp \ - graphicsview.cpp + graphicsview.cpp \ + rectbutton.cpp RESOURCES += stickman.qrc @@ -22,3 +24,4 @@ symbian { TARGET.UID3 = 0xA000E3F9 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/dbus/complexpingpong/complexping.desktop b/examples/dbus/complexpingpong/complexping.desktop new file mode 100644 index 0000000..0075856 --- /dev/null +++ b/examples/dbus/complexpingpong/complexping.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Complex Ping +Exec=/opt/usr/bin/complexping +Icon=complexping +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/dbus/complexpingpong/complexping.pro b/examples/dbus/complexpingpong/complexping.pro index a01aed6..276a39b 100644 --- a/examples/dbus/complexpingpong/complexping.pro +++ b/examples/dbus/complexpingpong/complexping.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT -= gui @@ -16,3 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/complexpingpong/complexpong.desktop b/examples/dbus/complexpingpong/complexpong.desktop new file mode 100644 index 0000000..2af77c5 --- /dev/null +++ b/examples/dbus/complexpingpong/complexpong.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Complex Pong +Exec=/opt/usr/bin/complexpong +Icon=complexpong +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/dbus/complexpingpong/complexpong.pro b/examples/dbus/complexpingpong/complexpong.pro index f60863f..4bb036a 100644 --- a/examples/dbus/complexpingpong/complexpong.pro +++ b/examples/dbus/complexpingpong/complexpong.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT -= gui @@ -16,3 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/dbus-chat/dbus-chat.desktop b/examples/dbus/dbus-chat/dbus-chat.desktop new file mode 100644 index 0000000..d25c82e --- /dev/null +++ b/examples/dbus/dbus-chat/dbus-chat.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=D-Bus Chat +Exec=/opt/usr/bin/dbus-chat +Icon=dbus-chat +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/dbus/dbus-chat/dbus-chat.pro b/examples/dbus/dbus-chat/dbus-chat.pro index 1316f64..5ed1bcc 100644 --- a/examples/dbus/dbus-chat/dbus-chat.pro +++ b/examples/dbus/dbus-chat/dbus-chat.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . CONFIG += qdbus @@ -19,3 +18,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/chat INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro index e599334..f6629b9 100644 --- a/examples/dbus/dbus.pro +++ b/examples/dbus/dbus.pro @@ -14,4 +14,3 @@ sources.files = *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/dbus INSTALLS += sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/dbus/listnames/listnames.desktop b/examples/dbus/listnames/listnames.desktop new file mode 100644 index 0000000..4b2047f --- /dev/null +++ b/examples/dbus/listnames/listnames.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=D-Bus List Names +Exec=/opt/usr/bin/listnames +Icon=listnames +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/dbus/listnames/listnames.pro b/examples/dbus/listnames/listnames.pro index 4b484a5..4809ded 100644 --- a/examples/dbus/listnames/listnames.pro +++ b/examples/dbus/listnames/listnames.pro @@ -1,5 +1,4 @@ TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT -= gui @@ -16,4 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/listnames INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/pingpong/ping.desktop b/examples/dbus/pingpong/ping.desktop new file mode 100644 index 0000000..b80ea88 --- /dev/null +++ b/examples/dbus/pingpong/ping.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=D-Bus Ping +Exec=/opt/usr/bin/ping +Icon=ping +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/dbus/pingpong/ping.pro b/examples/dbus/pingpong/ping.pro index 4b1affe..6d961c6 100644 --- a/examples/dbus/pingpong/ping.pro +++ b/examples/dbus/pingpong/ping.pro @@ -16,3 +16,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/pingpong/pong.desktop b/examples/dbus/pingpong/pong.desktop new file mode 100644 index 0000000..4b5ddc8 --- /dev/null +++ b/examples/dbus/pingpong/pong.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=D-Bus Pong +Exec=/opt/usr/bin/pong +Icon=pong +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/dbus/pingpong/pong.pro b/examples/dbus/pingpong/pong.pro index bd824e1..812677e 100644 --- a/examples/dbus/pingpong/pong.pro +++ b/examples/dbus/pingpong/pong.pro @@ -16,3 +16,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/remotecontrolledcar/car/car.desktop b/examples/dbus/remotecontrolledcar/car/car.desktop new file mode 100644 index 0000000..ab2c53b --- /dev/null +++ b/examples/dbus/remotecontrolledcar/car/car.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=D-Bus Remote Controlled Car +Exec=/opt/usr/bin/car +Icon=car +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/dbus/remotecontrolledcar/car/car.pro b/examples/dbus/remotecontrolledcar/car/car.pro index d362dc9..9a6931b 100644 --- a/examples/dbus/remotecontrolledcar/car/car.pro +++ b/examples/dbus/remotecontrolledcar/car/car.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . CONFIG += qdbus @@ -20,3 +19,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/car INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/remotecontrolledcar/controller/controller.desktop b/examples/dbus/remotecontrolledcar/controller/controller.desktop new file mode 100644 index 0000000..1ae6aa1 --- /dev/null +++ b/examples/dbus/remotecontrolledcar/controller/controller.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=D-Bus Remote Controller +Exec=/opt/usr/bin/controller +Icon=controller +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro index 375b9d7..788f0fe 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.pro +++ b/examples/dbus/remotecontrolledcar/controller/controller.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . CONFIG += qdbus @@ -21,3 +20,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/controller INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro index 6f29977..bb97388 100644 --- a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro +++ b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro @@ -7,4 +7,3 @@ sources.files = *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar INSTALLS += sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/declarative/animation/animation.qmlproject b/examples/declarative/animation/animation.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/animation/animation.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/animation/basics/basics.qmlproject b/examples/declarative/animation/basics/basics.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/animation/basics/basics.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/animation/basics/color-animation/coloranimation.desktop b/examples/declarative/animation/basics/color-animation/coloranimation.desktop new file mode 100644 index 0000000..b6df2d0 --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/coloranimation.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=color-animation +Exec=/opt/usr/bin/color-animation +Icon=color-animation +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/animation/basics/color-animation/coloranimation.png b/examples/declarative/animation/basics/color-animation/coloranimation.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/animation/basics/color-animation/coloranimation.png differ diff --git a/examples/declarative/animation/basics/color-animation/coloranimation.pro b/examples/declarative/animation/basics/color-animation/coloranimation.pro new file mode 100644 index 0000000..c8f6297 --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/coloranimation.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/animation/basics/color-animation/coloranimation.svg b/examples/declarative/animation/basics/color-animation/coloranimation.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/coloranimation.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + 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 0000000..1bf8fc2 --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/color-animation.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/animation/basics/color-animation/qml/basics.qmlproject b/examples/declarative/animation/basics/color-animation/qml/basics.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/qml/basics.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/animation/basics/color-animation/qml/color-animation.qml b/examples/declarative/animation/basics/color-animation/qml/color-animation.qml new file mode 100644 index 0000000..809f391 --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/qml/color-animation.qml @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/images/face-smile.png b/examples/declarative/animation/basics/color-animation/qml/images/face-smile.png new file mode 100644 index 0000000..3d66d72 Binary files /dev/null and b/examples/declarative/animation/basics/color-animation/qml/images/face-smile.png differ diff --git a/examples/declarative/animation/basics/color-animation/qml/images/moon.png b/examples/declarative/animation/basics/color-animation/qml/images/moon.png new file mode 100644 index 0000000..9407b2b Binary files /dev/null and b/examples/declarative/animation/basics/color-animation/qml/images/moon.png differ diff --git a/examples/declarative/animation/basics/color-animation/qml/images/shadow.png b/examples/declarative/animation/basics/color-animation/qml/images/shadow.png new file mode 100644 index 0000000..8270565 Binary files /dev/null and b/examples/declarative/animation/basics/color-animation/qml/images/shadow.png differ diff --git a/examples/declarative/animation/basics/color-animation/qml/images/star.png b/examples/declarative/animation/basics/color-animation/qml/images/star.png new file mode 100644 index 0000000..27ef924 Binary files /dev/null and b/examples/declarative/animation/basics/color-animation/qml/images/star.png differ diff --git a/examples/declarative/animation/basics/color-animation/qml/images/sun.png b/examples/declarative/animation/basics/color-animation/qml/images/sun.png new file mode 100644 index 0000000..7713ca5 Binary files /dev/null and b/examples/declarative/animation/basics/color-animation/qml/images/sun.png differ diff --git a/examples/declarative/animation/basics/color-animation/qml/property-animation.qml b/examples/declarative/animation/basics/color-animation/qml/property-animation.qml new file mode 100644 index 0000000..0a5b353 --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/qml/property-animation.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/animation/basics/images/face-smile.png b/examples/declarative/animation/basics/images/face-smile.png deleted file mode 100644 index 3d66d72..0000000 Binary files a/examples/declarative/animation/basics/images/face-smile.png and /dev/null differ diff --git a/examples/declarative/animation/basics/images/moon.png b/examples/declarative/animation/basics/images/moon.png deleted file mode 100644 index 9407b2b..0000000 Binary files a/examples/declarative/animation/basics/images/moon.png and /dev/null differ diff --git a/examples/declarative/animation/basics/images/shadow.png b/examples/declarative/animation/basics/images/shadow.png deleted file mode 100644 index 8270565..0000000 Binary files a/examples/declarative/animation/basics/images/shadow.png and /dev/null differ diff --git a/examples/declarative/animation/basics/images/star.png b/examples/declarative/animation/basics/images/star.png deleted file mode 100644 index 27ef924..0000000 Binary files a/examples/declarative/animation/basics/images/star.png and /dev/null differ diff --git a/examples/declarative/animation/basics/images/sun.png b/examples/declarative/animation/basics/images/sun.png deleted file mode 100644 index 7713ca5..0000000 Binary files a/examples/declarative/animation/basics/images/sun.png and /dev/null 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 0000000..6ae8859 --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/property-animation.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/animation/basics/property-animation/propertyanimation.desktop b/examples/declarative/animation/basics/property-animation/propertyanimation.desktop new file mode 100644 index 0000000..6155c2f --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/propertyanimation.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=property-animation +Exec=/opt/usr/bin/property-animation +Icon=property-animation +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/animation/basics/property-animation/propertyanimation.png b/examples/declarative/animation/basics/property-animation/propertyanimation.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/animation/basics/property-animation/propertyanimation.png differ diff --git a/examples/declarative/animation/basics/property-animation/propertyanimation.pro b/examples/declarative/animation/basics/property-animation/propertyanimation.pro new file mode 100644 index 0000000..97eb86c --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/propertyanimation.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/animation/basics/property-animation/propertyanimation.svg b/examples/declarative/animation/basics/property-animation/propertyanimation.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/propertyanimation.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/animation/basics/property-animation/qml/basics.qmlproject b/examples/declarative/animation/basics/property-animation/qml/basics.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qml/basics.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/animation/basics/property-animation/qml/color-animation.qml b/examples/declarative/animation/basics/property-animation/qml/color-animation.qml new file mode 100644 index 0000000..809f391 --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qml/color-animation.qml @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/property-animation/qml/images/face-smile.png b/examples/declarative/animation/basics/property-animation/qml/images/face-smile.png new file mode 100644 index 0000000..3d66d72 Binary files /dev/null and b/examples/declarative/animation/basics/property-animation/qml/images/face-smile.png differ diff --git a/examples/declarative/animation/basics/property-animation/qml/images/moon.png b/examples/declarative/animation/basics/property-animation/qml/images/moon.png new file mode 100644 index 0000000..9407b2b Binary files /dev/null and b/examples/declarative/animation/basics/property-animation/qml/images/moon.png differ diff --git a/examples/declarative/animation/basics/property-animation/qml/images/shadow.png b/examples/declarative/animation/basics/property-animation/qml/images/shadow.png new file mode 100644 index 0000000..8270565 Binary files /dev/null and b/examples/declarative/animation/basics/property-animation/qml/images/shadow.png differ diff --git a/examples/declarative/animation/basics/property-animation/qml/images/star.png b/examples/declarative/animation/basics/property-animation/qml/images/star.png new file mode 100644 index 0000000..27ef924 Binary files /dev/null and b/examples/declarative/animation/basics/property-animation/qml/images/star.png differ diff --git a/examples/declarative/animation/basics/property-animation/qml/images/sun.png b/examples/declarative/animation/basics/property-animation/qml/images/sun.png new file mode 100644 index 0000000..7713ca5 Binary files /dev/null and b/examples/declarative/animation/basics/property-animation/qml/images/sun.png differ diff --git a/examples/declarative/animation/basics/property-animation/qml/property-animation.qml b/examples/declarative/animation/basics/property-animation/qml/property-animation.qml new file mode 100644 index 0000000..0a5b353 --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qml/property-animation.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/README b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..3f1e89d --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package propertyanimation +---------------------------- + +Comments regarding the Package + + -- Daniel Molkentin Thu, 18 Nov 2010 16:22:35 +0100 diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/changelog b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..4e1c4df --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +propertyanimation (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Daniel Molkentin Thu, 18 Nov 2010 16:22:35 +0100 diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/compat b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/control b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..cc2e5ef --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/control @@ -0,0 +1,13 @@ +Source: propertyanimation +Section: user/hidden +Priority: optional +Maintainer: Daniel Molkentin +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: propertyanimation +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/copyright b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..e197e37 --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,40 @@ +This package was debianized by Daniel Molkentin on +Thu, 18 Nov 2010 16:22:35 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU 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 General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2010, Daniel Molkentin and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/rules b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..e838932 --- /dev/null +++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/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/propertyanimation.sgml > propertyanimation.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/propertyanimation. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/propertyanimation 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/examples/declarative/animation/behaviors/behavior-example/behaviorexample.desktop b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.desktop new file mode 100644 index 0000000..95af017 --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=behavior-example +Exec=/opt/usr/bin/behavior-example +Icon=behavior-example +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/animation/behaviors/behavior-example/behaviorexample.png b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.png differ diff --git a/examples/declarative/animation/behaviors/behavior-example/behaviorexample.pro b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.pro new file mode 100644 index 0000000..1bda064 --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/animation/behaviors/behavior-example/behaviorexample.svg b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + 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 0000000..5797077 --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/behavior-example.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/animation/behaviors/behavior-example/qml/SideRect.qml b/examples/declarative/animation/behaviors/behavior-example/qml/SideRect.qml new file mode 100644 index 0000000..9517421 --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/qml/SideRect.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/behavior-example.qml b/examples/declarative/animation/behaviors/behavior-example/qml/behavior-example.qml new file mode 100644 index 0000000..3e050ab --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/qml/behavior-example.qml @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/behavior-example/qml/behaviors.qmlproject b/examples/declarative/animation/behaviors/behavior-example/qml/behaviors.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/qml/behaviors.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/animation/behaviors/behavior-example/qml/wigglytext.qml b/examples/declarative/animation/behaviors/behavior-example/qml/wigglytext.qml new file mode 100644 index 0000000..6cd93ab --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/qml/wigglytext.qml @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/behavior-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/animation/behaviors/behaviors.qmlproject b/examples/declarative/animation/behaviors/behaviors.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/animation/behaviors/behaviors.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/animation/easing/content/quit.png b/examples/declarative/animation/easing/content/quit.png deleted file mode 100644 index b822057..0000000 Binary files a/examples/declarative/animation/easing/content/quit.png and /dev/null differ diff --git a/examples/declarative/animation/easing/easing.desktop b/examples/declarative/animation/easing/easing.desktop new file mode 100644 index 0000000..56437b5 --- /dev/null +++ b/examples/declarative/animation/easing/easing.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=easing +Exec=/opt/usr/bin/easing +Icon=easing +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/animation/easing/easing.png b/examples/declarative/animation/easing/easing.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/animation/easing/easing.png differ diff --git a/examples/declarative/animation/easing/easing.pro b/examples/declarative/animation/easing/easing.pro new file mode 100644 index 0000000..3273d9f --- /dev/null +++ b/examples/declarative/animation/easing/easing.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/animation/easing/easing.qmlproject b/examples/declarative/animation/easing/easing.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/animation/easing/easing.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* 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 0000000..566acfa --- /dev/null +++ b/examples/declarative/animation/easing/easing.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/animation/easing/main.cpp b/examples/declarative/animation/easing/main.cpp new file mode 100644 index 0000000..084c83a --- /dev/null +++ b/examples/declarative/animation/easing/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/easing.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/animation/easing/qml/content/QuitButton.qml b/examples/declarative/animation/easing/qml/content/QuitButton.qml new file mode 100644 index 0000000..cbbf916 --- /dev/null +++ b/examples/declarative/animation/easing/qml/content/QuitButton.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/quit.png b/examples/declarative/animation/easing/qml/content/quit.png new file mode 100644 index 0000000..b822057 Binary files /dev/null and b/examples/declarative/animation/easing/qml/content/quit.png differ diff --git a/examples/declarative/animation/easing/qml/easing.qml b/examples/declarative/animation/easing/qml/easing.qml new file mode 100644 index 0000000..fd974d9 --- /dev/null +++ b/examples/declarative/animation/easing/qml/easing.qml @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/qml/easing.qmlproject b/examples/declarative/animation/easing/qml/easing.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/animation/easing/qml/easing.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/animation/easing/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/animation/states/main.cpp b/examples/declarative/animation/states/main.cpp new file mode 100644 index 0000000..fec4662 --- /dev/null +++ b/examples/declarative/animation/states/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/states.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/animation/states/qml/qt-logo.png b/examples/declarative/animation/states/qml/qt-logo.png new file mode 100644 index 0000000..14ddf2a Binary files /dev/null and b/examples/declarative/animation/states/qml/qt-logo.png differ diff --git a/examples/declarative/animation/states/qml/states.qml b/examples/declarative/animation/states/qml/states.qml new file mode 100644 index 0000000..a9046eb --- /dev/null +++ b/examples/declarative/animation/states/qml/states.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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.qmlproject b/examples/declarative/animation/states/qml/states.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/animation/states/qml/states.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/animation/states/qml/transitions.qml b/examples/declarative/animation/states/qml/transitions.qml new file mode 100644 index 0000000..ea73b82 --- /dev/null +++ b/examples/declarative/animation/states/qml/transitions.qml @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/animation/states/qt-logo.png b/examples/declarative/animation/states/qt-logo.png deleted file mode 100644 index 14ddf2a..0000000 Binary files a/examples/declarative/animation/states/qt-logo.png and /dev/null differ diff --git a/examples/declarative/animation/states/states.desktop b/examples/declarative/animation/states/states.desktop new file mode 100644 index 0000000..31eb8d5 --- /dev/null +++ b/examples/declarative/animation/states/states.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=states +Exec=/opt/usr/bin/states +Icon=states +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/animation/states/states.png b/examples/declarative/animation/states/states.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/animation/states/states.png differ diff --git a/examples/declarative/animation/states/states.pro b/examples/declarative/animation/states/states.pro new file mode 100644 index 0000000..d25e7e4 --- /dev/null +++ b/examples/declarative/animation/states/states.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/animation/states/states.qmlproject b/examples/declarative/animation/states/states.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/animation/states/states.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* 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 0000000..566acfa --- /dev/null +++ b/examples/declarative/animation/states/states.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro index f700f0b..6493640 100644 --- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro +++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro @@ -26,3 +26,4 @@ symbian:{ importFiles.path = ImageProviderCore DEPLOYMENT += importFiles } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/declarative/cppextensions/plugins/plugins.pro b/examples/declarative/cppextensions/plugins/plugins.pro index b7610a8..0b9a354 100644 --- a/examples/declarative/cppextensions/plugins/plugins.pro +++ b/examples/declarative/cppextensions/plugins/plugins.pro @@ -27,3 +27,4 @@ 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/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro index d92e072..4b69432 100644 --- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro +++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro @@ -22,3 +22,4 @@ symbian:{ DEPLOYMENT += importFiles } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/declarative/demos/calculator/calculator.desktop b/examples/declarative/demos/calculator/calculator.desktop new file mode 100644 index 0000000..837d710 --- /dev/null +++ b/examples/declarative/demos/calculator/calculator.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=calculator +Exec=/opt/usr/bin/calculator +Icon=calculator +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/calculator/calculator.png b/examples/declarative/demos/calculator/calculator.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/demos/calculator/calculator.png differ diff --git a/examples/declarative/demos/calculator/calculator.pro b/examples/declarative/demos/calculator/calculator.pro new file mode 100644 index 0000000..7e433ac --- /dev/null +++ b/examples/declarative/demos/calculator/calculator.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 0xE187B2C4 + +# 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/calculator/calculator.svg b/examples/declarative/demos/calculator/calculator.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/demos/calculator/calculator.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/calculator/main.cpp b/examples/declarative/demos/calculator/main.cpp new file mode 100644 index 0000000..cf069b7 --- /dev/null +++ b/examples/declarative/demos/calculator/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/calculator.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/calculator/qml/Core/Button.qml b/examples/declarative/demos/calculator/qml/Core/Button.qml new file mode 100644 index 0000000..f37de48 --- /dev/null +++ b/examples/declarative/demos/calculator/qml/Core/Button.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +BorderImage { + id: button + + property alias operation: buttonText.text + property string color: "" + + signal clicked + + source: "images/button-" + color + ".png"; clip: true + border { left: 10; top: 10; right: 10; bottom: 10 } + + Rectangle { + id: shade + anchors.fill: button; radius: 10; color: "black"; opacity: 0 + } + + Text { + id: buttonText + anchors.centerIn: parent; anchors.verticalCenterOffset: -1 + font.pixelSize: parent.width > parent.height ? parent.height * .5 : parent.width * .5 + style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true + } + + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: { + doOp(operation) + button.clicked() + } + } + + states: State { + name: "pressed"; when: mouseArea.pressed == true + PropertyChanges { target: shade; opacity: .4 } + } +} diff --git a/examples/declarative/demos/calculator/qml/Core/Display.qml b/examples/declarative/demos/calculator/qml/Core/Display.qml new file mode 100644 index 0000000..f928d3a --- /dev/null +++ b/examples/declarative/demos/calculator/qml/Core/Display.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +BorderImage { + id: image + + property alias text : displayText.text + property alias currentOperation : operationText + + source: "images/display.png" + border { left: 10; top: 10; right: 10; bottom: 10 } + + Text { + id: displayText + anchors { + right: parent.right; verticalCenter: parent.verticalCenter; verticalCenterOffset: -1 + rightMargin: 6; left: operationText.right + } + font.pixelSize: parent.height * .6; text: "0"; horizontalAlignment: Text.AlignRight; elide: Text.ElideRight + color: "#343434"; smooth: true; font.bold: true + } + Text { + id: operationText + font.bold: true; font.pixelSize: parent.height * .7 + color: "#343434"; smooth: true + anchors { left: parent.left; leftMargin: 6; verticalCenterOffset: -3; verticalCenter: parent.verticalCenter } + } +} diff --git a/examples/declarative/demos/calculator/qml/Core/calculator.js b/examples/declarative/demos/calculator/qml/Core/calculator.js new file mode 100644 index 0000000..7c363c7 --- /dev/null +++ b/examples/declarative/demos/calculator/qml/Core/calculator.js @@ -0,0 +1,91 @@ + +var curVal = 0 +var memory = 0 +var lastOp = "" +var timer = 0 + +function disabled(op) { + if (op == "." && display.text.toString().search(/\./) != -1) { + return true + } else if (op == squareRoot && display.text.toString().search(/-/) != -1) { + return true + } else { + return false + } +} + +function doOperation(op) { + if (disabled(op)) { + return + } + + if (op.toString().length==1 && ((op >= "0" && op <= "9") || op==".") ) { + if (display.text.toString().length >= 14) + return; // No arbitrary length numbers + if (lastOp.toString().length == 1 && ((lastOp >= "0" && lastOp <= "9") || lastOp == ".") ) { + display.text = display.text + op.toString() + } else { + display.text = op + } + lastOp = op + return + } + lastOp = op + + if (display.currentOperation.text == "+") { + display.text = Number(display.text.valueOf()) + Number(curVal.valueOf()) + } else if (display.currentOperation.text == "-") { + display.text = Number(curVal) - Number(display.text.valueOf()) + } else if (display.currentOperation.text == multiplication) { + display.text = Number(curVal) * Number(display.text.valueOf()) + } else if (display.currentOperation.text == division) { + display.text = Number(Number(curVal) / Number(display.text.valueOf())).toString() + } else if (display.currentOperation.text == "=") { + } + + if (op == "+" || op == "-" || op == multiplication || op == division) { + display.currentOperation.text = op + curVal = display.text.valueOf() + return + } + + curVal = 0 + display.currentOperation.text = "" + + if (op == "1/x") { + display.text = (1 / display.text.valueOf()).toString() + } else if (op == "x^2") { + display.text = (display.text.valueOf() * display.text.valueOf()).toString() + } else if (op == "Abs") { + display.text = (Math.abs(display.text.valueOf())).toString() + } else if (op == "Int") { + display.text = (Math.floor(display.text.valueOf())).toString() + } else if (op == plusminus) { + display.text = (display.text.valueOf() * -1).toString() + } else if (op == squareRoot) { + display.text = (Math.sqrt(display.text.valueOf())).toString() + } else if (op == "mc") { + memory = 0; + } else if (op == "m+") { + memory += display.text.valueOf() + } else if (op == "mr") { + display.text = memory.toString() + } else if (op == "m-") { + memory = display.text.valueOf() + } else if (op == leftArrow) { + display.text = display.text.toString().slice(0, -1) + if (display.text.length == 0) { + display.text = "0" + } + } else if (op == "Off") { + Qt.quit(); + } else if (op == "C") { + display.text = "0" + } else if (op == "AC") { + curVal = 0 + memory = 0 + lastOp = "" + display.text ="0" + } +} + diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-.png b/examples/declarative/demos/calculator/qml/Core/images/button-.png new file mode 100644 index 0000000..544e514 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/Core/images/button-.png differ diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-blue.png b/examples/declarative/demos/calculator/qml/Core/images/button-blue.png new file mode 100644 index 0000000..5f92de3 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/Core/images/button-blue.png differ diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-green.png b/examples/declarative/demos/calculator/qml/Core/images/button-green.png new file mode 100644 index 0000000..36c9391 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/Core/images/button-green.png differ diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-purple.png b/examples/declarative/demos/calculator/qml/Core/images/button-purple.png new file mode 100644 index 0000000..347cbbe Binary files /dev/null and b/examples/declarative/demos/calculator/qml/Core/images/button-purple.png differ diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-red.png b/examples/declarative/demos/calculator/qml/Core/images/button-red.png new file mode 100644 index 0000000..3b33589 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/Core/images/button-red.png differ diff --git a/examples/declarative/demos/calculator/qml/Core/images/display.png b/examples/declarative/demos/calculator/qml/Core/images/display.png new file mode 100644 index 0000000..9507f43 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/Core/images/display.png differ diff --git a/examples/declarative/demos/calculator/qml/Core/qmldir b/examples/declarative/demos/calculator/qml/Core/qmldir new file mode 100644 index 0000000..a926b93 --- /dev/null +++ b/examples/declarative/demos/calculator/qml/Core/qmldir @@ -0,0 +1,2 @@ +Button Button.qml +Display Display.qml diff --git a/examples/declarative/demos/calculator/qml/calculator.qml b/examples/declarative/demos/calculator/qml/calculator.qml new file mode 100644 index 0000000..3e1c650 --- /dev/null +++ b/examples/declarative/demos/calculator/qml/calculator.qml @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "Core" +import "Core/calculator.js" as CalcEngine + +Rectangle { + id: window + + width: 480; height: 360 + 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 + + width: parent.width; height: parent.height; 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; width: window.height; height: window.width } + PropertyChanges { target: rotateButton; operation: rotateLeft } + }, + State { + name: "orientation " + Orientation.PortraitInverted + PropertyChanges { target: main; rotation: 180; } + PropertyChanges { target: rotateButton; operation: rotateRight } + }, + State { + name: "orientation " + Orientation.LandscapeInverted + PropertyChanges { target: main; rotation: 270; width: window.height; height: window.width } + PropertyChanges { target: rotateButton; operation: rotateLeft } + } + ] + + transitions: Transition { + SequentialAnimation { + PropertyAction { target: rotateButton; property: "operation" } + RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint } + NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint } + } + } + } +} diff --git a/examples/declarative/demos/calculator/qml/calculator.qmlproject b/examples/declarative/demos/calculator/qml/calculator.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/demos/calculator/qml/calculator.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/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/demos/flickr/flickr.desktop b/examples/declarative/demos/flickr/flickr.desktop new file mode 100644 index 0000000..5c8ce4f --- /dev/null +++ b/examples/declarative/demos/flickr/flickr.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=flickr +Exec=/opt/usr/bin/flickr +Icon=flickr +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/flickr/flickr.png b/examples/declarative/demos/flickr/flickr.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/demos/flickr/flickr.png differ diff --git a/examples/declarative/demos/flickr/flickr.pro b/examples/declarative/demos/flickr/flickr.pro new file mode 100644 index 0000000..4104bc5 --- /dev/null +++ b/examples/declarative/demos/flickr/flickr.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 0xE9DEEA70 + +# 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/flickr/flickr.svg b/examples/declarative/demos/flickr/flickr.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/demos/flickr/flickr.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/flickr/main.cpp b/examples/declarative/demos/flickr/main.cpp new file mode 100644 index 0000000..133f0d0 --- /dev/null +++ b/examples/declarative/demos/flickr/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); + viewer.setMainQmlFile(QLatin1String("qml/qml/flickr.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/flickr/qml/common/Progress.qml b/examples/declarative/demos/flickr/qml/common/Progress.qml new file mode 100644 index 0000000..b928554 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/common/Progress.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/common/RssModel.qml b/examples/declarative/demos/flickr/qml/common/RssModel.qml new file mode 100644 index 0000000..0c1c834 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/common/RssModel.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/common/ScrollBar.qml b/examples/declarative/demos/flickr/qml/common/ScrollBar.qml new file mode 100644 index 0000000..dfe3cbf --- /dev/null +++ b/examples/declarative/demos/flickr/qml/common/ScrollBar.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/common/Slider.qml b/examples/declarative/demos/flickr/qml/common/Slider.qml new file mode 100644 index 0000000..edccc7d --- /dev/null +++ b/examples/declarative/demos/flickr/qml/common/Slider.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/common/qmldir b/examples/declarative/demos/flickr/qml/common/qmldir new file mode 100644 index 0000000..adc2479 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/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/examples/declarative/demos/flickr/qml/flickr-90.qml b/examples/declarative/demos/flickr/qml/flickr-90.qml new file mode 100644 index 0000000..31b1d91 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/flickr-90.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + width: 480; height: 320 + + Loader { + y: 320; rotation: -90 + transformOrigin: Item.TopLeft + source: "flickr.qml" + } +} diff --git a/examples/declarative/demos/flickr/qml/flickr.qml b/examples/declarative/demos/flickr/qml/flickr.qml new file mode 100644 index 0000000..740ee35 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/flickr.qml @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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: 100 + 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/examples/declarative/demos/flickr/qml/flickr.qmlproject b/examples/declarative/demos/flickr/qml/flickr.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/flickr.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/demos/flickr/qml/mobile/Button.qml b/examples/declarative/demos/flickr/qml/mobile/Button.qml new file mode 100644 index 0000000..74a7dbb --- /dev/null +++ b/examples/declarative/demos/flickr/qml/mobile/Button.qml @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/mobile/GridDelegate.qml b/examples/declarative/demos/flickr/qml/mobile/GridDelegate.qml new file mode 100644 index 0000000..8f01292 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/mobile/GridDelegate.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/mobile/ImageDetails.qml b/examples/declarative/demos/flickr/qml/mobile/ImageDetails.qml new file mode 100644 index 0000000..9d1464e --- /dev/null +++ b/examples/declarative/demos/flickr/qml/mobile/ImageDetails.qml @@ -0,0 +1,186 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/mobile/ListDelegate.qml b/examples/declarative/demos/flickr/qml/mobile/ListDelegate.qml new file mode 100644 index 0000000..0773547 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/mobile/ListDelegate.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/mobile/TitleBar.qml b/examples/declarative/demos/flickr/qml/mobile/TitleBar.qml new file mode 100644 index 0000000..f283307 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/mobile/TitleBar.qml @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/mobile/ToolBar.qml b/examples/declarative/demos/flickr/qml/mobile/ToolBar.qml new file mode 100644 index 0000000..d8abb14 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/mobile/ToolBar.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/flickr/qml/mobile/images/gloss.png b/examples/declarative/demos/flickr/qml/mobile/images/gloss.png new file mode 100644 index 0000000..5d370cd Binary files /dev/null and b/examples/declarative/demos/flickr/qml/mobile/images/gloss.png differ diff --git a/examples/declarative/demos/flickr/qml/mobile/images/lineedit.png b/examples/declarative/demos/flickr/qml/mobile/images/lineedit.png new file mode 100644 index 0000000..2cc38dc Binary files /dev/null and b/examples/declarative/demos/flickr/qml/mobile/images/lineedit.png differ diff --git a/examples/declarative/demos/flickr/qml/mobile/images/lineedit.sci b/examples/declarative/demos/flickr/qml/mobile/images/lineedit.sci new file mode 100644 index 0000000..054bff7 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/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/examples/declarative/demos/flickr/qml/mobile/images/quit.png b/examples/declarative/demos/flickr/qml/mobile/images/quit.png new file mode 100644 index 0000000..5bda1b6 Binary files /dev/null and b/examples/declarative/demos/flickr/qml/mobile/images/quit.png differ diff --git a/examples/declarative/demos/flickr/qml/mobile/images/stripes.png b/examples/declarative/demos/flickr/qml/mobile/images/stripes.png new file mode 100644 index 0000000..9f36727 Binary files /dev/null and b/examples/declarative/demos/flickr/qml/mobile/images/stripes.png differ diff --git a/examples/declarative/demos/flickr/qml/mobile/images/titlebar.png b/examples/declarative/demos/flickr/qml/mobile/images/titlebar.png new file mode 100644 index 0000000..51c9008 Binary files /dev/null and b/examples/declarative/demos/flickr/qml/mobile/images/titlebar.png differ diff --git a/examples/declarative/demos/flickr/qml/mobile/images/titlebar.sci b/examples/declarative/demos/flickr/qml/mobile/images/titlebar.sci new file mode 100644 index 0000000..0418d94 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/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/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.png b/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.png new file mode 100644 index 0000000..1131001 Binary files /dev/null and b/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.png differ diff --git a/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.sci b/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.sci new file mode 100644 index 0000000..9e4f965 --- /dev/null +++ b/examples/declarative/demos/flickr/qml/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/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/demos/photoviewer/main.cpp b/examples/declarative/demos/photoviewer/main.cpp new file mode 100644 index 0000000..f718dc2 --- /dev/null +++ b/examples/declarative/demos/photoviewer/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); + viewer.setMainQmlFile(QLatin1String("qml/qml/photoviewer.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/photoviewer/photoviewer.desktop b/examples/declarative/demos/photoviewer/photoviewer.desktop new file mode 100644 index 0000000..0ff4d15 --- /dev/null +++ b/examples/declarative/demos/photoviewer/photoviewer.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=photoviewer +Exec=/opt/usr/bin/photoviewer +Icon=photoviewer +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/photoviewer/photoviewer.png b/examples/declarative/demos/photoviewer/photoviewer.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/demos/photoviewer/photoviewer.png differ diff --git a/examples/declarative/demos/photoviewer/photoviewer.pro b/examples/declarative/demos/photoviewer/photoviewer.pro new file mode 100644 index 0000000..0760998 --- /dev/null +++ b/examples/declarative/demos/photoviewer/photoviewer.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 0xE1762B94 + +# 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/photoviewer/photoviewer.svg b/examples/declarative/demos/photoviewer/photoviewer.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/demos/photoviewer/photoviewer.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/AlbumDelegate.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/AlbumDelegate.qml new file mode 100644 index 0000000..9001033 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/AlbumDelegate.qml @@ -0,0 +1,146 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Component { + id: albumDelegate + Package { + + Item { + Package.name: 'browser' + GridView { + id: photosGridView; model: visualModel.parts.grid; width: mainWindow.width; height: mainWindow.height - 21 + x: 0; y: 21; cellWidth: 160; cellHeight: 153; interactive: false + onCurrentIndexChanged: photosListView.positionViewAtIndex(currentIndex, ListView.Contain) + } + } + + Item { + Package.name: 'fullscreen' + ListView { + id: photosListView; model: visualModel.parts.list; orientation: Qt.Horizontal + width: mainWindow.width; height: mainWindow.height; interactive: false + onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain) + highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem + } + } + + Item { + Package.name: 'album' + id: albumWrapper; width: 210; height: 220 + + VisualDataModel { + id: visualModel; delegate: PhotoDelegate { } + model: RssModel { id: rssModel; tags: tag } + } + + BusyIndicator { + id: busyIndicator + anchors { centerIn: parent; verticalCenterOffset: -20 } + on: rssModel.status != XmlListModel.Ready + } + + PathView { + id: photosPathView; model: visualModel.parts.stack; pathItemCount: 5 + visible: !busyIndicator.visible + anchors.centerIn: parent; anchors.verticalCenterOffset: -30 + path: Path { + PathAttribute { name: 'z'; value: 9999.0 } + PathLine { x: 1; y: 1 } + PathAttribute { name: 'z'; value: 0.0 } + } + } + + MouseArea { + anchors.fill: parent + onClicked: mainWindow.editMode ? photosModel.remove(index) : albumWrapper.state = 'inGrid' + } + + Tag { + anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 } + frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode + onTagChanged: rssModel.tags = tag + onBackClicked: if (mainWindow.editMode) photosModel.remove(index); + } + + states: [ + State { + name: 'inGrid' + PropertyChanges { target: photosGridView; interactive: true } + PropertyChanges { target: albumsShade; opacity: 1 } + PropertyChanges { target: backButton; onClicked: albumWrapper.state = ''; y: 6 } + }, + State { + name: 'fullscreen'; extend: 'inGrid' + PropertyChanges { target: photosGridView; interactive: false } + PropertyChanges { target: photosListView; interactive: true } + PropertyChanges { target: photosShade; opacity: 1 } + PropertyChanges { target: backButton; y: -backButton.height - 8 } + } + ] + + GridView.onAdd: NumberAnimation { + target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad + } + GridView.onRemove: SequentialAnimation { + PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true } + NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad } + PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false } + } + + transitions: [ + Transition { + from: '*'; to: 'inGrid' + SequentialAnimation { + NumberAnimation { properties: 'opacity'; duration: 250 } + PauseAnimation { duration: 350 } + NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad } + } + }, + Transition { + from: 'inGrid'; to: '*' + NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 } + } + ] + } + } +} diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/BusyIndicator.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/BusyIndicator.qml new file mode 100644 index 0000000..7b28930 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/BusyIndicator.qml @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Image { + id: container + property bool on: false + + source: "images/busy.png"; visible: container.on + NumberAnimation on rotation { running: container.on; from: 0; to: 360; loops: Animation.Infinite; duration: 1200 } +} diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Button.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Button.qml new file mode 100644 index 0000000..29f2bb7 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Button.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + property alias label: labelText.text + property color tint: "transparent" + signal clicked + + width: labelText.width + 70 ; height: labelText.height + 18 + + BorderImage { + anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } + source: 'images/box-shadow.png'; smooth: true + border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 + } + + Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true } + + Rectangle { + anchors.fill: container; color: container.tint; visible: container.tint != "" + opacity: 0.25; smooth: true + } + + Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent; smooth: true } + + MouseArea { + anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } + onClicked: container.clicked() + } +} diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/EditableButton.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/EditableButton.qml new file mode 100644 index 0000000..06f8062 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/EditableButton.qml @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + property string label + signal clicked + signal labelChanged(string label) + + width: textInput.width + 70 ; height: textInput.height + 18 + + BorderImage { + anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } + source: 'images/box-shadow.png'; smooth: true + border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 + } + + Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true } + + TextInput { + id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent; smooth: true + Keys.onReturnPressed: { + container.labelChanged(textInput.text) + container.focus = true + } + Keys.onEnterPressed: { + container.labelChanged(textInput.text) + container.focus = true + } + Keys.onEscapePressed: { + textInput.text = container.label + container.focus = true + } + } + + Rectangle { + anchors.fill: container; border.color: "steelblue"; border.width: 4 + color: "transparent"; visible: textInput.focus; smooth: true + } + + MouseArea { + anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } + onClicked: { textInput.forceActiveFocus(); textInput.openSoftwareInputPanel(); } + } +} diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/PhotoDelegate.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/PhotoDelegate.qml new file mode 100644 index 0000000..5948b5d --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/PhotoDelegate.qml @@ -0,0 +1,188 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "script/script.js" as Script + +Package { + Item { id: stackItem; Package.name: 'stack'; width: 160; height: 153; z: stackItem.PathView.z } + Item { id: listItem; Package.name: 'list'; width: mainWindow.width + 40; height: 153 } + Item { id: gridItem; Package.name: 'grid'; width: 160; height: 153 } + + Item { + width: 160; height: 153 + + Item { + id: photoWrapper + + property double randomAngle: Math.random() * (2 * 6 + 1) - 6 + property double randomAngle2: Math.random() * (2 * 6 + 1) - 6 + + x: 0; y: 0; width: 140; height: 133 + z: stackItem.PathView.z; rotation: photoWrapper.randomAngle + + BorderImage { + anchors { + fill: border.visible ? 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) + fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height + } + Image { + id: hqImage; smooth: true; source: ""; visible: false + fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height + } + Binding { + target: mainWindow; property: "downloadProgress"; value: hqImage.progress + when: listItem.ListView.isCurrentItem + } + Binding { + target: mainWindow; property: "imageLoading" + value: (hqImage.status == Image.Loading) ? 1 : 0; when: listItem.ListView.isCurrentItem + } + MouseArea { + width: originalImage.paintedWidth; height: originalImage.paintedHeight; anchors.centerIn: originalImage + onClicked: { + if (albumWrapper.state == 'inGrid') { + gridItem.GridView.view.currentIndex = index; + albumWrapper.state = 'fullscreen' + } else { + gridItem.GridView.view.currentIndex = index; + albumWrapper.state = 'inGrid' + } + } + } + + states: [ + State { + name: 'stacked'; when: albumWrapper.state == '' + ParentChange { target: photoWrapper; parent: stackItem; x: 10; y: 10 } + PropertyChanges { target: photoWrapper; opacity: stackItem.PathView.onPath ? 1.0 : 0.0 } + }, + State { + name: 'inGrid'; when: albumWrapper.state == 'inGrid' + ParentChange { target: photoWrapper; parent: gridItem; x: 10; y: 10; rotation: photoWrapper.randomAngle2 } + }, + State { + name: 'fullscreen'; when: albumWrapper.state == 'fullscreen' + ParentChange { + target: photoWrapper; parent: listItem; x: 0; y: 0; rotation: 0 + width: mainWindow.width; height: mainWindow.height + } + PropertyChanges { target: border; opacity: 0 } + PropertyChanges { target: hqImage; source: listItem.ListView.isCurrentItem ? hq : ""; visible: true } + } + ] + + transitions: [ + Transition { + from: 'stacked'; to: 'inGrid' + SequentialAnimation { + PauseAnimation { duration: 10 * index } + ParentAnimation { + target: photoWrapper; via: foreground + NumberAnimation { + target: photoWrapper; properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' + } + } + } + }, + Transition { + from: 'inGrid'; to: 'stacked' + ParentAnimation { + target: photoWrapper; via: foreground + NumberAnimation { properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' } + } + }, + Transition { + from: 'inGrid'; to: 'fullscreen' + SequentialAnimation { + PauseAnimation { duration: gridItem.GridView.isCurrentItem ? 0 : 600 } + ParentAnimation { + target: photoWrapper; via: foreground + NumberAnimation { + targets: [ photoWrapper, border ] + properties: 'x,y,width,height,opacity,rotation' + duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart' + } + } + } + }, + Transition { + from: 'fullscreen'; to: 'inGrid' + ParentAnimation { + target: photoWrapper; via: foreground + NumberAnimation { + targets: [ photoWrapper, border ] + properties: 'x,y,width,height,rotation,opacity' + duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart' + } + } + } + ] + } + } +} diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/ProgressBar.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/ProgressBar.qml new file mode 100644 index 0000000..a0756ae --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/ProgressBar.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + property real progress: 0 + + Behavior on opacity { NumberAnimation { duration: 600 } } + + Rectangle { anchors.fill: parent; color: "black"; opacity: 0.5 } + + Rectangle { + id: fill; color: "white"; height: container.height + width: container.width * container.progress + } +} diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/RssModel.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/RssModel.qml new file mode 100644 index 0000000..15bb67f --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/RssModel.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +XmlListModel { + property string tags : "" + + source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "") + query: "/feed/entry" + namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';" + + XmlRole { name: "title"; query: "title/string()" } + XmlRole { name: "content"; query: "content/string()" } + XmlRole { name: "hq"; query: "link[@rel='enclosure']/@href/string()" } +} diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Tag.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Tag.qml new file mode 100644 index 0000000..9358975 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Tag.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Flipable { + id: flipable + + property alias frontLabel: frontButton.label + property alias backLabel: backButton.label + + property int angle: 0 + property int randomAngle: Math.random() * (2 * 6 + 1) - 6 + property bool flipped: false + + signal frontClicked + signal backClicked + signal tagChanged(string tag) + + front: EditableButton { + id: frontButton; rotation: flipable.randomAngle + anchors { centerIn: parent; verticalCenterOffset: -20 } + onClicked: flipable.frontClicked() + onLabelChanged: flipable.tagChanged(label) + } + + back: Button { + id: backButton; tint: "red"; rotation: flipable.randomAngle + anchors { centerIn: parent; verticalCenterOffset: -20 } + onClicked: flipable.backClicked() + } + + transform: Rotation { + origin.x: flipable.width / 2; origin.y: flipable.height / 2 + axis.x: 0; axis.y: 1; axis.z: 0 + angle: flipable.angle + } + + states: State { + name: "back"; when: flipable.flipped + PropertyChanges { target: flipable; angle: 180 } + } + + transitions: Transition { + ParallelAnimation { + NumberAnimation { properties: "angle"; duration: 400 } + SequentialAnimation { + NumberAnimation { target: flipable; property: "scale"; to: 0.8; duration: 200 } + NumberAnimation { target: flipable; property: "scale"; to: 1.0; duration: 200 } + } + } + } +} diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/box-shadow.png b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/box-shadow.png new file mode 100644 index 0000000..431af85 Binary files /dev/null and b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/box-shadow.png differ diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/busy.png b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/busy.png new file mode 100644 index 0000000..664c2b1 Binary files /dev/null and b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/busy.png differ diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/cardboard.png b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/cardboard.png new file mode 100644 index 0000000..1847ab5 Binary files /dev/null and b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/cardboard.png differ diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/qmldir b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/qmldir new file mode 100644 index 0000000..d3c247f --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/qmldir @@ -0,0 +1,8 @@ +AlbumDelegate AlbumDelegate.qml +PhotoDelegate PhotoDelegate.qml +ProgressBar ProgressBar.qml +RssModel RssModel.qml +BusyIndicator BusyIndicator.qml +EditableButton EditableButton.qml +Button Button.qml +Tag Tag.qml diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/script/script.js b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/script/script.js new file mode 100644 index 0000000..e8ef93a --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/script/script.js @@ -0,0 +1,27 @@ +.pragma library + +function getWidth(string) { + return (string.match(/width=\"([0-9]+)\"/))[1] +} + +function getHeight(string) { + return (string.match(/height=\"([0-9]+)\"/))[1] +} + +function getImagePath(string) { + var pattern = /src=\"http:\/\/(\S+)\"/ + return (string.match(pattern))[1] +} + +function calculateScale(width, height, cellSize) { + var widthScale = (cellSize * 1.0) / width + var heightScale = (cellSize * 1.0) / height + var scale = 0 + + if (widthScale <= heightScale) { + scale = widthScale; + } else if (heightScale < widthScale) { + scale = heightScale; + } + return scale; +} diff --git a/examples/declarative/demos/photoviewer/qml/i18n/base.ts b/examples/declarative/demos/photoviewer/qml/i18n/base.ts new file mode 100644 index 0000000..1accfd2 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/i18n/base.ts @@ -0,0 +1,30 @@ + + + + + AlbumDelegate + + + Remove + + + + + photoviewer + + + Add + + + + + Edit + + + + + Back + + + + diff --git a/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.qm b/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.qm new file mode 100644 index 0000000..c24fcbc Binary files /dev/null and b/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.qm differ diff --git a/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.ts b/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.ts new file mode 100644 index 0000000..9f892db --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.ts @@ -0,0 +1,30 @@ + + + + + AlbumDelegate + + + Remove + Supprimer + + + + photoviewer + + + Add + Ajouter + + + + Edit + Éditer + + + + Back + Retour + + + diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer.qml b/examples/declarative/demos/photoviewer/qml/photoviewer.qml new file mode 100644 index 0000000..0f59c64 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer.qml @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "PhotoViewerCore" + +Rectangle { + id: mainWindow + + property real downloadProgress: 0 + property bool imageLoading: false + property bool editMode: false + + width: 800; height: 480; color: "#d5d6d8" + + ListModel { + id: photosModel + ListElement { tag: "Flowers" } + ListElement { tag: "Wildlife" } + ListElement { tag: "Prague" } + } + + VisualDataModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} } + + GridView { + id: albumView; width: parent.width; height: parent.height; cellWidth: 210; cellHeight: 220 + model: albumVisualModel.parts.album; visible: albumsShade.opacity != 1.0 + } + + Column { + spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 } + Button { + id: newButton; label: qsTr("Add"); rotation: 3 + anchors.horizontalCenter: parent.horizontalCenter + onClicked: { + mainWindow.editMode = false + photosModel.append( { tag: "" } ) + albumView.positionViewAtIndex(albumView.count - 1, GridView.Contain) + } + } + Button { + id: deleteButton; label: qsTr("Edit"); rotation: -2; + onClicked: mainWindow.editMode = !mainWindow.editMode + anchors.horizontalCenter: parent.horizontalCenter + } + Button { + id: quitButton; label: qsTr("Quit"); rotation: -2; + onClicked: Qt.quit() + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Rectangle { + id: albumsShade; color: mainWindow.color + width: parent.width; height: parent.height; opacity: 0.0 + } + + ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false } + + Button { id: backButton; label: qsTr("Back"); rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 } + + Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 } + + ListView { anchors.fill: parent; model: albumVisualModel.parts.fullscreen; interactive: false } + + Item { id: foreground; anchors.fill: parent } + + ProgressBar { + progress: mainWindow.downloadProgress; width: parent.width; height: 4 + anchors.bottom: parent.bottom; opacity: mainWindow.imageLoading; visible: opacity != 0.0 + } +} diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer.qmlproject b/examples/declarative/demos/photoviewer/qml/photoviewer.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer.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/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/demos/rssnews/main.cpp b/examples/declarative/demos/rssnews/main.cpp new file mode 100644 index 0000000..ad57596 --- /dev/null +++ b/examples/declarative/demos/rssnews/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/rssnews.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/rssnews/qml/content/BusyIndicator.qml b/examples/declarative/demos/rssnews/qml/content/BusyIndicator.qml new file mode 100644 index 0000000..e305cbe --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/content/BusyIndicator.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Image { + id: container + property bool on: false + + source: "images/busy.png"; visible: container.on + + NumberAnimation on rotation { + running: container.on; from: 0; to: 360; loops: Animation.Infinite; duration: 1200 + } +} diff --git a/examples/declarative/demos/rssnews/qml/content/CategoryDelegate.qml b/examples/declarative/demos/rssnews/qml/content/CategoryDelegate.qml new file mode 100644 index 0000000..c4fa8cc --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/content/CategoryDelegate.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: delegate + + width: delegate.ListView.view.width; height: 60 + + Text { + text: name + color: delegate.ListView.isCurrentItem ? "white" : "black" + font { family: "Helvetica"; pixelSize: 16; bold: true } + anchors { + left: parent.left; leftMargin: 15 + verticalCenter: parent.verticalCenter + } + } + + BusyIndicator { + scale: 0.6 + on: delegate.ListView.isCurrentItem && window.loading + anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter } + } + + Rectangle { + width: delegate.width; height: 1; color: "#cccccc" + anchors.bottom: delegate.bottom + visible: delegate.ListView.isCurrentItem ? false : true + } + Rectangle { + width: delegate.width; height: 1; color: "white" + visible: delegate.ListView.isCurrentItem ? false : true + } + + MouseArea { + anchors.fill: delegate + onClicked: { + delegate.ListView.view.currentIndex = index + window.currentFeed = feed + } + } +} diff --git a/examples/declarative/demos/rssnews/qml/content/NewsDelegate.qml b/examples/declarative/demos/rssnews/qml/content/NewsDelegate.qml new file mode 100644 index 0000000..cf88f4e --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/content/NewsDelegate.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: delegate + height: column.height + 40 + width: delegate.ListView.view.width + + Column { + id: column + x: 20; y: 20 + width: parent.width - 40 + + Text { + id: titleText + text: title; width: parent.width; wrapMode: Text.WordWrap + font { bold: true; family: "Helvetica"; pointSize: 16 } + } + + Text { + id: descriptionText + width: parent.width; text: description + wrapMode: Text.WordWrap; font.family: "Helvetica" + } + } + + Rectangle { + width: parent.width; height: 1; color: "#cccccc" + anchors.bottom: parent.bottom + } +} diff --git a/examples/declarative/demos/rssnews/qml/content/RssFeeds.qml b/examples/declarative/demos/rssnews/qml/content/RssFeeds.qml new file mode 100644 index 0000000..37c4b69 --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/content/RssFeeds.qml @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +ListModel { + id: rssFeeds + + ListElement { name: "Top Stories"; feed: "rss.news.yahoo.com/rss/topstories" } + ListElement { name: "World"; feed: "rss.news.yahoo.com/rss/world" } + ListElement { name: "Europe"; feed: "rss.news.yahoo.com/rss/europe" } + ListElement { name: "Oceania"; feed: "rss.news.yahoo.com/rss/oceania" } + ListElement { name: "U.S. National"; feed: "rss.news.yahoo.com/rss/us" } + ListElement { name: "Politics"; feed: "rss.news.yahoo.com/rss/politics" } + ListElement { name: "Business"; feed: "rss.news.yahoo.com/rss/business" } + ListElement { name: "Technology"; feed: "rss.news.yahoo.com/rss/tech" } + ListElement { name: "Entertainment"; feed: "rss.news.yahoo.com/rss/entertainment" } + ListElement { name: "Health"; feed: "rss.news.yahoo.com/rss/health" } + ListElement { name: "Science"; feed: "rss.news.yahoo.com/rss/science" } + ListElement { name: "Sports"; feed: "rss.news.yahoo.com/rss/sports" } +} diff --git a/examples/declarative/demos/rssnews/qml/content/ScrollBar.qml b/examples/declarative/demos/rssnews/qml/content/ScrollBar.qml new file mode 100644 index 0000000..f20f0aa --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/content/ScrollBar.qml @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + property variant scrollArea + property variant orientation: Qt.Vertical + + opacity: 0 + + function position() + { + var ny = 0; + if (container.orientation == Qt.Vertical) + ny = scrollArea.visibleArea.yPosition * container.height; + else + ny = scrollArea.visibleArea.xPosition * container.width; + if (ny > 2) return ny; else return 2; + } + + function size() + { + var nh, ny; + + if (container.orientation == Qt.Vertical) + nh = scrollArea.visibleArea.heightRatio * container.height; + else + nh = scrollArea.visibleArea.widthRatio * container.width; + + if (container.orientation == Qt.Vertical) + ny = scrollArea.visibleArea.yPosition * container.height; + else + ny = scrollArea.visibleArea.xPosition * container.width; + + if (ny > 3) { + var t; + if (container.orientation == Qt.Vertical) + t = Math.ceil(container.height - 3 - ny); + else + t = Math.ceil(container.width - 3 - ny); + if (nh > t) return t; else return nh; + } else return nh + ny; + } + + Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.3 } + + BorderImage { + source: "images/scrollbar.png" + border { left: 1; right: 1; top: 1; bottom: 1 } + x: container.orientation == Qt.Vertical ? 2 : position() + width: container.orientation == Qt.Vertical ? container.width - 4 : size() + y: container.orientation == Qt.Vertical ? position() : 2 + height: container.orientation == Qt.Vertical ? size() : container.height - 4 + } + + states: State { + name: "visible" + when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally + PropertyChanges { target: container; opacity: 1.0 } + } + + transitions: Transition { + from: "visible"; to: "" + NumberAnimation { properties: "opacity"; duration: 600 } + } +} diff --git a/examples/declarative/demos/rssnews/qml/content/images/busy.png b/examples/declarative/demos/rssnews/qml/content/images/busy.png new file mode 100644 index 0000000..664c2b1 Binary files /dev/null and b/examples/declarative/demos/rssnews/qml/content/images/busy.png differ diff --git a/examples/declarative/demos/rssnews/qml/content/images/scrollbar.png b/examples/declarative/demos/rssnews/qml/content/images/scrollbar.png new file mode 100644 index 0000000..0228dcf Binary files /dev/null and b/examples/declarative/demos/rssnews/qml/content/images/scrollbar.png differ diff --git a/examples/declarative/demos/rssnews/qml/rssnews.qml b/examples/declarative/demos/rssnews/qml/rssnews.qml new file mode 100644 index 0000000..f6fe188 --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/rssnews.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "content" + +Rectangle { + id: window + width: 800; height: 480 + + property string currentFeed: "rss.news.yahoo.com/rss/topstories" + property bool loading: feedModel.status == XmlListModel.Loading + + RssFeeds { id: rssFeeds } + + XmlListModel { + id: feedModel + source: "http://" + window.currentFeed + query: "/rss/channel/item" + + XmlRole { name: "title"; query: "title/string()" } + XmlRole { name: "link"; query: "link/string()" } + XmlRole { name: "description"; query: "description/string()" } + } + + Row { + Rectangle { + width: 220; height: window.height + color: "#efefef" + + ListView { + focus: true + id: categories + anchors.fill: parent + model: rssFeeds + footer: quitButtonDelegate + delegate: CategoryDelegate {} + highlight: Rectangle { color: "steelblue" } + highlightMoveSpeed: 9999999 + } + ScrollBar { + scrollArea: categories; height: categories.height; width: 8 + anchors.right: categories.right + } + } + ListView { + id: list + width: window.width - 220; height: window.height + model: feedModel + delegate: NewsDelegate {} + } + } + Component { + id: quitButtonDelegate + Item { + width: categories.width; height: 60 + Text { + text: "Quit" + font { family: "Helvetica"; pixelSize: 16; bold: true } + anchors { + left: parent.left; leftMargin: 15 + verticalCenter: parent.verticalCenter + } + } + MouseArea { + anchors.fill: parent + onClicked: Qt.quit() + } + } + } + ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right } + Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" } +} diff --git a/examples/declarative/demos/rssnews/qml/rssnews.qmlproject b/examples/declarative/demos/rssnews/qml/rssnews.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/rssnews.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/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/demos/rssnews/rssnews.desktop b/examples/declarative/demos/rssnews/rssnews.desktop new file mode 100644 index 0000000..ba6110f --- /dev/null +++ b/examples/declarative/demos/rssnews/rssnews.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=rssnews +Exec=/opt/usr/bin/rssnews +Icon=rssnews +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/rssnews/rssnews.png b/examples/declarative/demos/rssnews/rssnews.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/demos/rssnews/rssnews.png differ diff --git a/examples/declarative/demos/rssnews/rssnews.pro b/examples/declarative/demos/rssnews/rssnews.pro new file mode 100644 index 0000000..a44d567 --- /dev/null +++ b/examples/declarative/demos/rssnews/rssnews.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 0xE72E9E51 + +# 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/rssnews/rssnews.svg b/examples/declarative/demos/rssnews/rssnews.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/demos/rssnews/rssnews.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/samegame/main.cpp b/examples/declarative/demos/samegame/main.cpp new file mode 100644 index 0000000..d70b1d3 --- /dev/null +++ b/examples/declarative/demos/samegame/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); + viewer.setMainQmlFile(QLatin1String("qml/qml/samegame.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/BoomBlock.qml b/examples/declarative/demos/samegame/qml/SamegameCore/BoomBlock.qml new file mode 100644 index 0000000..afda29c --- /dev/null +++ b/examples/declarative/demos/samegame/qml/SamegameCore/BoomBlock.qml @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.labs.particles 1.0 + +Item { + id: block + property bool dying: false + property bool spawned: false + property int type: 0 + + Behavior on x { + enabled: spawned; + SpringAnimation{ spring: 2; damping: 0.2 } + } + Behavior on y { + SpringAnimation{ spring: 2; damping: 0.2 } + } + + Image { + id: img + source: { + if(type == 0){ + "pics/redStone.png"; + } else if(type == 1) { + "pics/blueStone.png"; + } else { + "pics/greenStone.png"; + } + } + opacity: 0 + Behavior on opacity { NumberAnimation { duration: 200 } } + anchors.fill: parent + } + + Particles { + id: particles + + width: 1; height: 1 + anchors.centerIn: parent + + emissionRate: 0 + lifeSpan: 700; lifeSpanDeviation: 600 + angle: 0; angleDeviation: 360; + velocity: 100; velocityDeviation: 30 + source: { + if(type == 0){ + "pics/redStar.png"; + } else if (type == 1) { + "pics/blueStar.png"; + } else { + "pics/greenStar.png"; + } + } + } + + states: [ + State { + name: "AliveState"; when: spawned == true && dying == false + PropertyChanges { target: img; opacity: 1 } + }, + + State { + name: "DeathState"; when: dying == true + StateChangeScript { script: particles.burst(50); } + PropertyChanges { target: img; opacity: 0 } + StateChangeScript { script: block.destroy(1000); } + } + ] +} diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/Button.qml b/examples/declarative/demos/samegame/qml/SamegameCore/Button.qml new file mode 100644 index 0000000..140b196 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/SamegameCore/Button.qml @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: container + + property string text: "Button" + + signal clicked + + width: buttonLabel.width + 20; height: buttonLabel.height + 20 + smooth: true + border { width: 1; color: Qt.darker(activePalette.button) } + radius: 8 + color: activePalette.button + + gradient: Gradient { + GradientStop { + position: 0.0 + color: { + if (mouseArea.pressed) + return activePalette.dark + else + return activePalette.light + } + } + GradientStop { position: 1.0; color: activePalette.button } + } + + MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + + Text { + id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText; font.pixelSize: 24 + } +} diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/Dialog.qml b/examples/declarative/demos/samegame/qml/SamegameCore/Dialog.qml new file mode 100644 index 0000000..e1f3900 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/SamegameCore/Dialog.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: page + + property Item text: dialogText + + signal closed + signal opened + function forceClose() { + if(page.opacity == 0) + return; //already closed + page.closed(); + page.opacity = 0; + } + + function show(txt) { + page.opened(); + dialogText.text = txt; + page.opacity = 1; + } + + width: dialogText.width + 20; height: dialogText.height + 20 + color: "white" + border.width: 1 + opacity: 0 + visible: opacity > 0 + Behavior on opacity { + NumberAnimation { duration: 1000 } + } + + Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } + + MouseArea { anchors.fill: parent; onClicked: forceClose(); } +} + diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/background.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/background.png new file mode 100644 index 0000000..3734a27 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/background.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStar.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStar.png new file mode 100644 index 0000000..ff9588f Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStar.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStone.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStone.png new file mode 100644 index 0000000..20e43c7 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStone.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStar.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStar.png new file mode 100644 index 0000000..cd06854 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStar.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStone.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStone.png new file mode 100644 index 0000000..b568a19 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStone.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStar.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStar.png new file mode 100644 index 0000000..0a4dffe Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStar.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStone.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStone.png new file mode 100644 index 0000000..36b09a2 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStone.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/star.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/star.png new file mode 100644 index 0000000..defbde5 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/star.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/yellowStone.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/yellowStone.png new file mode 100644 index 0000000..b1ce762 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/SamegameCore/pics/yellowStone.png differ diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/qmldir b/examples/declarative/demos/samegame/qml/SamegameCore/qmldir new file mode 100644 index 0000000..e17b1f5 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/SamegameCore/qmldir @@ -0,0 +1,3 @@ +BoomBlock BoomBlock.qml +Button Button.qml +Dialog Dialog.qml diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/samegame.js b/examples/declarative/demos/samegame/qml/SamegameCore/samegame.js new file mode 100644 index 0000000..9266767 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/SamegameCore/samegame.js @@ -0,0 +1,238 @@ +/* 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); + +//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= 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=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 0){ + for(row=0; row=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; + 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 + } +} + +//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); + 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; +} + +function saveHighScore(name) { + if(scoresURL!="") + sendHighScore(name); + //OfflineStorage + 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'; + } + dialog.show(r); + } + ); +} + +function sendHighScore(name) { + var postman = new XMLHttpRequest() + var postData = "name="+name+"&score="+gameCanvas.score + +"&gridSize="+maxColumn+"x"+maxRow +"&time="+Math.floor(gameDuration/1000); + postman.open("POST", scoresURL, true); + postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + postman.onreadystatechange = function() { + if (postman.readyState == postman.DONE) { + dialog.show("Your score has been uploaded."); + } + } + postman.send(postData); +} diff --git a/examples/declarative/demos/samegame/qml/highscores/README b/examples/declarative/demos/samegame/qml/highscores/README new file mode 100644 index 0000000..eaa00fa --- /dev/null +++ b/examples/declarative/demos/samegame/qml/highscores/README @@ -0,0 +1 @@ +The SameGame example can interface with a simple PHP script to store XML high score data on a remote server. We do not have a publically accessible server available for this use, but if you have access to a PHP capable webserver you can copy the files (score_data.xml, score.php, score_style.xsl) to it and alter the highscore_server variable at the top of the samegame.js file to point to it. diff --git a/examples/declarative/demos/samegame/qml/highscores/score_data.xml b/examples/declarative/demos/samegame/qml/highscores/score_data.xml new file mode 100644 index 0000000..c3fd90d --- /dev/null +++ b/examples/declarative/demos/samegame/qml/highscores/score_data.xml @@ -0,0 +1,2 @@ +1000000Alan the Tester0x00 +6213Alan12x1751 diff --git a/examples/declarative/demos/samegame/qml/highscores/score_style.xsl b/examples/declarative/demos/samegame/qml/highscores/score_style.xsl new file mode 100644 index 0000000..670354c --- /dev/null +++ b/examples/declarative/demos/samegame/qml/highscores/score_style.xsl @@ -0,0 +1,28 @@ + + + + + SameGame High Scores + +

SameGame High Scores

+ + + + + + + + + + + + + + + + +
NameScoreGrid SizeTime, s
+ + + + diff --git a/examples/declarative/demos/samegame/qml/highscores/scores.php b/examples/declarative/demos/samegame/qml/highscores/scores.php new file mode 100644 index 0000000..3cceb2d --- /dev/null +++ b/examples/declarative/demos/samegame/qml/highscores/scores.php @@ -0,0 +1,34 @@ +"; + echo "SameGame High Scores"; + if($score > 0){#Sending in a new high score + $name = $_POST["name"]; + $grid = $_POST["gridSize"]; + $time = $_POST["time"]; + if($name == "") + $name = "Anonymous"; + //if($grid != "10x10"){ + //Need a standard, so as to reject others? + //} + $file = fopen("score_data.xml", "a"); #It's XML. Happy? + $ret = fwrite($file, "". $score . "" + . $name . "" . $grid . "" + . $time . "\n"); + echo "Your score has been recorded. Thanks for playing!"; + if($ret == False) + echo "
There was an error though, so don't expect to see that score again."; + }else{#Read high score list + #Now uses XSLT to display. So just print the file. With XML cruft added. + #Note that firefox at least won't apply the XSLT on a php file. So redirecting + $file = fopen("scores.xml", "w"); + $ret = fwrite($file, '' . "\n" + . '' . "\n" + . "\n" . file_get_contents("score_data.xml") . "\n"); + if($ret == False) + echo "There was an internal error. Sorry."; + else + echo ''; + } + echo ""; +?> diff --git a/examples/declarative/demos/samegame/qml/samegame.qml b/examples/declarative/demos/samegame/qml/samegame.qml new file mode 100644 index 0000000..ab49c04 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame.qml @@ -0,0 +1,161 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "SamegameCore" +import "SamegameCore/samegame.js" as Logic + +Rectangle { + id: screen + width: 490; height: 720 + property bool inAnotherDemo: false //Samegame often is just plonked straight into other demos + + SystemPalette { id: activePalette } + + Item { + width: parent.width + anchors { top: parent.top; bottom: toolBar.top } + + Image { + id: background + anchors.fill: parent + source: "SamegameCore/pics/background.png" + fillMode: Image.PreserveAspectCrop + } + + Item { + id: gameCanvas + property int score: 0 + property int blockSize: 40 + + z: 20; anchors.centerIn: parent + width: parent.width - (parent.width % blockSize); + height: parent.height - (parent.height % blockSize); + + MouseArea { + anchors.fill: parent; onClicked: Logic.handleClick(mouse.x,mouse.y); + } + } + } + + Dialog { id: dialog; anchors.centerIn: parent; z: 21 } + + Dialog { + id: nameInputDialog + + property int initialWidth: 0 + property alias name: nameInputText.text + + anchors.centerIn: parent + z: 22; + + Behavior on width { + NumberAnimation {} + enabled: nameInputDialog.initialWidth != 0 + } + + onClosed: { + if (nameInputText.text != "") + Logic.saveHighScore(nameInputText.text); + } + Text { + id: dialogText + anchors { left: nameInputDialog.left; leftMargin: 20; verticalCenter: parent.verticalCenter } + text: "You won! Please enter your name: " + } + MouseArea { + anchors.fill: parent + onClicked: { + if (nameInputText.text == "") + nameInputText.openSoftwareInputPanel(); + else + nameInputDialog.forceClose(); + } + } + + TextInput { + id: nameInputText + anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } + focus: visible + autoScroll: false + maximumLength: 24 + onTextChanged: { + var newWidth = nameInputText.width + dialogText.width + 40; + if ( (newWidth > nameInputDialog.width && newWidth < screen.width) + || (nameInputDialog.width > nameInputDialog.initialWidth) ) + nameInputDialog.width = newWidth; + } + onAccepted: { + nameInputDialog.forceClose(); + } + } + } + + Rectangle { + id: toolBar + width: parent.width; height: 58 + color: activePalette.window + anchors.bottom: screen.bottom + + Button { + id: newGameButton + anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + text: "New Game" + onClicked: Logic.startNewGame() + } + + Button { + visible: !inAnotherDemo + text: "Quit" + anchors { left: newGameButton.right; leftMargin: 3; verticalCenter: parent.verticalCenter } + onClicked: Qt.quit(); + } + + Text { + id: score + anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + text: "Score: " + gameCanvas.score + font.bold: true + font.pixelSize: 24 + color: activePalette.windowText + } + } +} diff --git a/examples/declarative/demos/samegame/qml/samegame.qmlproject b/examples/declarative/demos/samegame/qml/samegame.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame.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/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/demos/samegame/samegame.desktop b/examples/declarative/demos/samegame/samegame.desktop new file mode 100644 index 0000000..e9e79c6 --- /dev/null +++ b/examples/declarative/demos/samegame/samegame.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=samegame +Exec=/opt/usr/bin/samegame +Icon=samegame +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/samegame/samegame.png b/examples/declarative/demos/samegame/samegame.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/demos/samegame/samegame.png differ diff --git a/examples/declarative/demos/samegame/samegame.pro b/examples/declarative/demos/samegame/samegame.pro new file mode 100644 index 0000000..ac548d5 --- /dev/null +++ b/examples/declarative/demos/samegame/samegame.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 0xE6438E92 + +# 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/samegame/samegame.svg b/examples/declarative/demos/samegame/samegame.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/demos/samegame/samegame.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/twitter/main.cpp b/examples/declarative/demos/twitter/main.cpp new file mode 100644 index 0000000..b3b58df --- /dev/null +++ b/examples/declarative/demos/twitter/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); + viewer.setMainQmlFile(QLatin1String("qml/qml/twitter.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/Button.qml b/examples/declarative/demos/twitter/qml/TwitterCore/Button.qml new file mode 100644 index 0000000..a1fc2a2 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/Button.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + signal clicked + + property string text + property bool keyUsing: false + + BorderImage { + id: buttonImage + source: "images/toolbutton.sci" + width: container.width; height: container.height + } + BorderImage { + id: pressed + opacity: 0 + source: "images/toolbutton.sci" + width: container.width; height: container.height + } + MouseArea { + id: mouseRegion + anchors.fill: buttonImage + onClicked: { container.clicked(); } + } + Text { + id: btnText + color: if(container.keyUsing){"#D0D0D0";} else {"#FFFFFF";} + anchors.centerIn: buttonImage; font.bold: true + text: container.text; style: Text.Raised; styleColor: "black" + font.pixelSize: 12 + } + states: [ + State { + name: "Pressed" + when: mouseRegion.pressed == true + PropertyChanges { target: pressed; opacity: 1 } + }, + State { + name: "Focused" + when: container.activeFocus == true + PropertyChanges { target: btnText; color: "#FFFFFF" } + } + ] + transitions: Transition { + ColorAnimation { target: btnText; } + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/FatDelegate.qml b/examples/declarative/demos/twitter/qml/TwitterCore/FatDelegate.qml new file mode 100644 index 0000000..896abbe --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/FatDelegate.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Component { + id: listDelegate + Item { + id: wrapper; width: wrapper.ListView.view.width; height: if(txt.height > 60){txt.height+10}else{60} //50+5+5 + function handleLink(link){ + if(link.slice(0,3) == 'app'){ + screen.setUser(link.slice(7)); + }else if(link.slice(0,4) == 'http'){ + Qt.openUrlExternally(link); + } + } + function addTags(str){ + var ret = str.replace(/@[a-zA-Z0-9_]+/g, '$&');//click to jump to user? + var ret2 = ret.replace(/http:\/\/[^ \n\t]+/g, '$&');//surrounds http links with html link tags + return ret2; + } + + // Strip away paranthesis + function userName(str) { + var user = str.replace(/\([\S|\s]*\)/gi, ""); + return user.trim(); + } + + Item { + id: moveMe; height: parent.height + Rectangle { + id: blackRect + color: "black"; opacity: wrapper.ListView.index % 2 ? 0.2 : 0.3; height: wrapper.height-2; width: wrapper.width; y: 1 + } + Item { + id: image; x: 6; width: 48; height: 48; smooth: true + anchors.verticalCenter: parent.verticalCenter + + Loading { x: 1; y: 1; width: 48; height: 48; visible: realImage.status != Image.Ready } + Image { + id: realImage; + source: userImage; x: 1; y: 1; + width:48; height:48; opacity:0 ; + onStatusChanged: { + if(status==Image.Ready) + image.state="loaded" + } + } + states: State { + name: "loaded"; + PropertyChanges { target: realImage ; opacity:1 } + } + transitions: Transition { NumberAnimation { target: realImage; property: "opacity"; duration: 200 } } + + } + Text { id:txt; y:4; x: 56 + text: '' + + ''+userName(name) + " from " +source + + "
" + statusText + ""; + textFormat: Qt.RichText + color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap + anchors.left: image.right; anchors.right: blackRect.right; anchors.leftMargin: 6; anchors.rightMargin: 6 + onLinkActivated: wrapper.handleLink(link) + } + } + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/Input.qml b/examples/declarative/demos/twitter/qml/TwitterCore/Input.qml new file mode 100644 index 0000000..b15f0d5 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/Input.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +FocusScope { + id:container + width: 220 + height: 28 + BorderImage { source: "images/lineedit.sci"; anchors.fill: parent } + signal accepted + property alias text: input.text + property alias item:input + TextInput{ + id: input + width: parent.width - 12 + anchors.centerIn: parent + maximumLength:21 + font.pixelSize: 16; + font.bold: true + color: "#151515"; selectionColor: "mediumseagreen" + focus: true + onAccepted:{container.accepted()} + text: "" + selectByMouse: true + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/Loading.qml b/examples/declarative/demos/twitter/qml/TwitterCore/Loading.qml new file mode 100644 index 0000000..afeafa0 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/Loading.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Image { + id: loading; source: "images/loading.png" + NumberAnimation on rotation { + from: 0; to: 360; running: loading.visible == true; loops: Animation.Infinite; duration: 900 + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/MultiTitleBar.qml b/examples/declarative/demos/twitter/qml/TwitterCore/MultiTitleBar.qml new file mode 100644 index 0000000..bc8e0de --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/MultiTitleBar.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + TitleBar { id: titleBar; width: parent.width; height: 60; + y: -80 + untaggedString: "Latest tweets from everyone" + taggedString: "Latest tweets from " + } + states: [ + State { + name: "search"; when: screen.state!="search" + PropertyChanges { target: titleBar; y: 0 } + } + ] + transitions: [ + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } + ] +} + diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/RssModel.qml b/examples/declarative/demos/twitter/qml/TwitterCore/RssModel.qml new file mode 100644 index 0000000..276df62 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/RssModel.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { id: wrapper + property variant model: xmlModel + property string from : "" + property string to : "" + property string phrase : "" + + property string mode : "everyone" + property int status: xmlModel.status + function reload() { xmlModel.reload(); } + XmlListModel { + id: xmlModel + + source: (from=="" && to=="" && phrase=="") ? "" : + 'http://search.twitter.com/search.atom?from='+from+"&to="+to+"&phrase="+phrase + + namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom'; " + + "declare namespace twitter=\"http://api.twitter.com/\";"; + + query: "/feed/entry" + + XmlRole { name: "statusText"; query: "content/string()" } + XmlRole { name: "timestamp"; query: "published/string()" } + XmlRole { name: "source"; query: "twitter:source/string()" } + XmlRole { name: "name"; query: "author/name/string()" } + XmlRole { name: "userImage"; query: "link[@rel = 'image']/@href/string()" } + + } + Binding { + property: "mode" + target: wrapper + value: {if(wrapper.tags==''){"everyone";}else if(wrapper.tags=='my timeline'){"self";}else{"user";}} + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/SearchView.qml b/examples/declarative/demos/twitter/qml/TwitterCore/SearchView.qml new file mode 100644 index 0000000..effab30 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/SearchView.qml @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +FocusScope { + id: wrapper + Column { + anchors.centerIn: parent + spacing: 20 + Column{ + spacing: 4 + Text { + text: "Posted by:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: fromIn + KeyNavigation.backtab: searchbutton + KeyNavigation.tab:toIn + onAccepted:searchbutton.doSearch(); + focus: true + } + Text { + text: "In reply to:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: toIn + KeyNavigation.backtab: fromIn + KeyNavigation.tab:phraseIn + onAccepted:searchbutton.doSearch(); + } + Text { + text: "Search phrase:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: phraseIn + KeyNavigation.backtab: toIn + KeyNavigation.tab:searchbutton + onAccepted:searchbutton.doSearch(); + text: "Qt Quick" + } + } + Button { + width: 100 + height: 32 + id: searchbutton + keyUsing: true; + opacity: 1 + text: "Search" + KeyNavigation.tab: fromIn + Keys.onReturnPressed: searchbutton.doSearch(); + Keys.onEnterPressed: searchbutton.doSearch(); + Keys.onSelectPressed: searchbutton.doSearch(); + Keys.onSpacePressed: searchbutton.doSearch(); + onClicked: searchbutton.doSearch(); + + function doSearch() { + // Search ! allowed + if (wrapper.state=="invalidinput") + return; + + rssModel.from=fromIn.text; + rssModel.to= toIn.text; + rssModel.phrase = phraseIn.text; + screen.focus = true; + screen.state = "" + } + } + } + states: + State { + name: "invalidinput" + when: fromIn.text=="" && toIn.text=="" && phraseIn.text=="" + PropertyChanges { target: searchbutton ; opacity: 0.6 ; } + } + transitions: + Transition { + NumberAnimation { target: searchbutton; property: "opacity"; duration: 200 } + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/TitleBar.qml b/examples/declarative/demos/twitter/qml/TwitterCore/TitleBar.qml new file mode 100644 index 0000000..19da491 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/TitleBar.qml @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: titleBar + property string untaggedString: "Uploads from everyone" + property string taggedString: "Recent uploads tagged " + + BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } + + Item { + id: container + width: (parent.width * 2) - 55 ; height: parent.height + + function accept() { + titleBar.state = "" + background.state = "" + rssModel.tags = editor.text + } + + Item { + id:imageBox + x: 6; width: 0; height: 50; smooth: true + anchors.verticalCenter: parent.verticalCenter + + UserModel { user: rssModel.from; id: userModel } + Component { + id: imgDelegate; + Item { + id:imageitem + visible:true + Loading { width:48; height:48; visible: realImage.status != Image.Ready } + Image { id: realImage; source: image; width:48; height:48; opacity:0; } + states: + State { + name: "loaded" + when: (realImage.status == Image.Ready) + PropertyChanges { target: realImage; opacity:1 } + } + transitions: Transition { + NumberAnimation { target: realImage; property: "opacity"; duration: 200 } + } + } + } + ListView { id:view; model: userModel.model; x:1; y:1; delegate: imgDelegate } + states: + State { + when: !userModel.user=="" + PropertyChanges { target: imageBox; width: 50; } + } + transitions: + Transition { + NumberAnimation { target: imageBox; property: "width"; duration: 200 } + } + } + + Image { + id: quitButton + x: 5 + anchors.verticalCenter: parent.verticalCenter + source: "images/quit.png" + MouseArea { + anchors.fill: parent + onClicked: Qt.quit() + } + } + + Text { + id: categoryText + anchors { + left: quitButton.right; right: parent.right; leftMargin: 10; rightMargin: 10 + verticalCenter: parent.verticalCenter + } + elide: Text.ElideLeft + text: (rssModel.from=="" ? untaggedString : taggedString + rssModel.from) + font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black" + font.pixelSize: 12 + } + } + + states: State { + name: "Tags" + PropertyChanges { target: container; x: -tagButton.x + 5 } + PropertyChanges { target: editor; focus: true } + } + + transitions: Transition { + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/ToolBar.qml b/examples/declarative/demos/twitter/qml/TwitterCore/ToolBar.qml new file mode 100644 index 0000000..4ef92ff --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/ToolBar.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: toolbar + + property alias button1Label: button1.text + property alias button2Label: button2.text + signal button1Clicked + signal button2Clicked + focus:true + BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } + Button { + id: button1 + anchors.left: parent.left; anchors.leftMargin: 5; y: 3; width: 140; height: 32 + onClicked: toolbar.button1Clicked() + focus:true + } + Button { + id: button2 + anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 32 + onClicked: toolbar.button2Clicked() + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/UserModel.qml b/examples/declarative/demos/twitter/qml/TwitterCore/UserModel.qml new file mode 100644 index 0000000..013b827 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/UserModel.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +//This "model" gets the user information about the searched user. Mainly for the icon. + +Item { id: wrapper + property variant model: xmlModel + property string user : "" + property int status: xmlModel.status + function reload() { xmlModel.reload(); } + XmlListModel { + id: xmlModel + + source: user!= "" ? "http://twitter.com/users/show.xml?screen_name="+user : "" + query: "/user" + + XmlRole { name: "name"; query: "name/string()" } + XmlRole { name: "screenName"; query: "screen_name/string()" } + XmlRole { name: "image"; query: "profile_image_url/string()" } + XmlRole { name: "location"; query: "location/string()" } + XmlRole { name: "description"; query: "description/string()" } + XmlRole { name: "followers"; query: "followers_count/string()" } + //TODO: Could also get the user's color scheme, timezone and a few other things + } +} diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/gloss.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/gloss.png new file mode 100644 index 0000000..5d370cd Binary files /dev/null and b/examples/declarative/demos/twitter/qml/TwitterCore/images/gloss.png differ diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.png new file mode 100644 index 0000000..2cc38dc Binary files /dev/null and b/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.png differ diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.sci b/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.sci new file mode 100644 index 0000000..054bff7 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.sci @@ -0,0 +1,5 @@ +border.left: 10 +border.top: 10 +border.bottom: 10 +border.right: 10 +source: lineedit.png diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/loading.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/loading.png new file mode 100644 index 0000000..47a1589 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/TwitterCore/images/loading.png differ diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/quit.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/quit.png new file mode 100644 index 0000000..5bda1b6 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/TwitterCore/images/quit.png differ diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/stripes.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/stripes.png new file mode 100644 index 0000000..9f36727 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/TwitterCore/images/stripes.png differ diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.png new file mode 100644 index 0000000..51c9008 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.png differ diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.sci b/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.sci new file mode 100644 index 0000000..0418d94 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.sci @@ -0,0 +1,5 @@ +border.left: 10 +border.top: 12 +border.bottom: 12 +border.right: 10 +source: titlebar.png diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.png new file mode 100644 index 0000000..1131001 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.png differ diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.sci b/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.sci new file mode 100644 index 0000000..9e4f965 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.sci @@ -0,0 +1,5 @@ +border.left: 15 +border.top: 4 +border.bottom: 4 +border.right: 15 +source: toolbutton.png diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/qmldir b/examples/declarative/demos/twitter/qml/TwitterCore/qmldir new file mode 100644 index 0000000..84d85c2 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/TwitterCore/qmldir @@ -0,0 +1,10 @@ +SearchView 1.0 SearchView.qml +Button 1.0 Button.qml +Input 1.0 Input.qml +FatDelegate 1.0 FatDelegate.qml +Loading 1.0 Loading.qml +MultiTitleBar 1.0 MultiTitleBar.qml +TitleBar 1.0 TitleBar.qml +RssModel 1.0 RssModel.qml +UserModel 1.0 UserModel.qml +ToolBar 1.0 ToolBar.qml diff --git a/examples/declarative/demos/twitter/qml/twitter.qml b/examples/declarative/demos/twitter/qml/twitter.qml new file mode 100644 index 0000000..74bab37 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter.qml @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "TwitterCore" 1.0 as Twitter + +Item { + id: screen; width: 320; height: 480 + property bool userView : false + property variant tmpStr + function setUser(str){hack.running = true; tmpStr = str} + function reallySetUser(){rssModel.from = tmpStr;rssModel.to = ""; rssModel.phrase = ""} + state:"searchquery" + //Workaround for bug 260266 + Timer{ interval: 1; running: false; repeat: false; onTriggered: screen.reallySetUser(); id:hack } + Keys.onEscapePressed: screen.state="searchquery" + Keys.onBacktabPressed: screen.state="searchquery" + Rectangle { + id: background + anchors.fill: parent; color: "#343434"; + + state:"searchquery" + Image { source: "TwitterCore/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } + + MouseArea { + anchors.fill: parent + onClicked: screen.focus = false; + } + + Twitter.RssModel { id: rssModel } + Twitter.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'} + Text { + width: 180 + text: "Could not access twitter using this screen name and password pair."; + color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap + visible: rssModel.status==XmlListModel.Error; anchors.centerIn: parent + } + + Item { + id: views + x: 2; width: parent.width - 4 + y:60 //Below the title bars + height: parent.height - 100 + + Text { + id:title + text: "Search Twitter" + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: 20; font.bold: true; color: "#bbb"; style: Text.Raised; styleColor: "black" + opacity:0 + } + + Twitter.SearchView{ + id: searchView + anchors.verticalCenter: parent.verticalCenter + width: parent.width; height: parent.height-60; + x: -(screen.width * 1.5) + } + + Twitter.FatDelegate { id: fatDelegate } + ListView { + id: mainView; model: rssModel.model; delegate: fatDelegate; + width: parent.width; height: parent.height; x: 0; cacheBuffer: 100; + } + } + + Twitter.MultiTitleBar { id: titleBar; width: parent.width } + Twitter.ToolBar { id: toolBar; height: 40; + //anchors.bottom: parent.bottom; + //TODO: Use anchor changes instead of hard coding + y: screen.height - 40 + width: parent.width; opacity: 0.9 + button1Label: "New Search" + button2Label: "Update" + onButton1Clicked: + { + screen.state="searchquery" + } + onButton2Clicked: rssModel.reload(); + } + } + states: [ + State { + name: "searchquery"; + PropertyChanges { target: searchView; x: 0; focus:true} + PropertyChanges { target: mainView; x: -(parent.width * 1.5) } + PropertyChanges { target: titleBar; y: -80 } + PropertyChanges { target: toolBar; y: screen.height } + PropertyChanges { target: toolBar } + PropertyChanges { target: title; opacity:1} + } + ] + transitions: [ + Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutQuad } } + ] +} diff --git a/examples/declarative/demos/twitter/qml/twitter.qmlproject b/examples/declarative/demos/twitter/qml/twitter.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter.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/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/demos/twitter/twitter.desktop b/examples/declarative/demos/twitter/twitter.desktop new file mode 100644 index 0000000..afe52c5 --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=twitter +Exec=/opt/usr/bin/twitter +Icon=twitter +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/twitter/twitter.png b/examples/declarative/demos/twitter/twitter.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/demos/twitter/twitter.png differ diff --git a/examples/declarative/demos/twitter/twitter.pro b/examples/declarative/demos/twitter/twitter.pro new file mode 100644 index 0000000..253e5db --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 0xE49225BD + +# 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/twitter/twitter.svg b/examples/declarative/demos/twitter/twitter.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/webbrowser/main.cpp b/examples/declarative/demos/webbrowser/main.cpp new file mode 100644 index 0000000..cd08611 --- /dev/null +++ b/examples/declarative/demos/webbrowser/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); + viewer.setMainQmlFile(QLatin1String("qml/qml/webbrowser.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/webbrowser/qml/content/Button.qml b/examples/declarative/demos/webbrowser/qml/content/Button.qml new file mode 100644 index 0000000..2da1c11 --- /dev/null +++ b/examples/declarative/demos/webbrowser/qml/content/Button.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/webbrowser/qml/content/FlickableWebView.qml b/examples/declarative/demos/webbrowser/qml/content/FlickableWebView.qml new file mode 100644 index 0000000..6f4e09c --- /dev/null +++ b/examples/declarative/demos/webbrowser/qml/content/FlickableWebView.qml @@ -0,0 +1,195 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/zoomFactor // 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/examples/declarative/demos/webbrowser/qml/content/Header.qml b/examples/declarative/demos/webbrowser/qml/content/Header.qml new file mode 100644 index 0000000..88e3000 --- /dev/null +++ b/examples/declarative/demos/webbrowser/qml/content/Header.qml @@ -0,0 +1,150 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/webbrowser/qml/content/ScrollBar.qml b/examples/declarative/demos/webbrowser/qml/content/ScrollBar.qml new file mode 100644 index 0000000..19309fa --- /dev/null +++ b/examples/declarative/demos/webbrowser/qml/content/ScrollBar.qml @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/webbrowser/qml/content/UrlInput.qml b/examples/declarative/demos/webbrowser/qml/content/UrlInput.qml new file mode 100644 index 0000000..0468b64 --- /dev/null +++ b/examples/declarative/demos/webbrowser/qml/content/UrlInput.qml @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/webbrowser/qml/content/pics/display.png b/examples/declarative/demos/webbrowser/qml/content/pics/display.png new file mode 100644 index 0000000..9507f43 Binary files /dev/null and b/examples/declarative/demos/webbrowser/qml/content/pics/display.png differ diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/edit-delete.png b/examples/declarative/demos/webbrowser/qml/content/pics/edit-delete.png new file mode 100644 index 0000000..df2a147 Binary files /dev/null and b/examples/declarative/demos/webbrowser/qml/content/pics/edit-delete.png differ diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/go-jump-locationbar.png b/examples/declarative/demos/webbrowser/qml/content/pics/go-jump-locationbar.png new file mode 100644 index 0000000..61f779c Binary files /dev/null and b/examples/declarative/demos/webbrowser/qml/content/pics/go-jump-locationbar.png differ diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/go-next-view.png b/examples/declarative/demos/webbrowser/qml/content/pics/go-next-view.png new file mode 100644 index 0000000..a585cab Binary files /dev/null and b/examples/declarative/demos/webbrowser/qml/content/pics/go-next-view.png differ diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/go-previous-view.png b/examples/declarative/demos/webbrowser/qml/content/pics/go-previous-view.png new file mode 100644 index 0000000..612fb34 Binary files /dev/null and b/examples/declarative/demos/webbrowser/qml/content/pics/go-previous-view.png differ diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/scrollbar.png b/examples/declarative/demos/webbrowser/qml/content/pics/scrollbar.png new file mode 100644 index 0000000..0228dcf Binary files /dev/null and b/examples/declarative/demos/webbrowser/qml/content/pics/scrollbar.png differ diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/titlebar-bg.png b/examples/declarative/demos/webbrowser/qml/content/pics/titlebar-bg.png new file mode 100644 index 0000000..06961e8 Binary files /dev/null and b/examples/declarative/demos/webbrowser/qml/content/pics/titlebar-bg.png differ diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/view-refresh.png b/examples/declarative/demos/webbrowser/qml/content/pics/view-refresh.png new file mode 100644 index 0000000..afa2a9d Binary files /dev/null and b/examples/declarative/demos/webbrowser/qml/content/pics/view-refresh.png differ diff --git a/examples/declarative/demos/webbrowser/qml/webbrowser.qml b/examples/declarative/demos/webbrowser/qml/webbrowser.qml new file mode 100644 index 0000000..a21fa0b --- /dev/null +++ b/examples/declarative/demos/webbrowser/qml/webbrowser.qml @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 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/examples/declarative/demos/webbrowser/qml/webbrowser.qmlproject b/examples/declarative/demos/webbrowser/qml/webbrowser.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/demos/webbrowser/qml/webbrowser.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/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/demos/webbrowser/webbrowser.desktop b/examples/declarative/demos/webbrowser/webbrowser.desktop new file mode 100644 index 0000000..26da1fe --- /dev/null +++ b/examples/declarative/demos/webbrowser/webbrowser.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=webbrowser +Exec=/opt/usr/bin/webbrowser +Icon=webbrowser +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/webbrowser/webbrowser.png b/examples/declarative/demos/webbrowser/webbrowser.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/demos/webbrowser/webbrowser.png differ diff --git a/examples/declarative/demos/webbrowser/webbrowser.pro b/examples/declarative/demos/webbrowser/webbrowser.pro new file mode 100644 index 0000000..580cc55 --- /dev/null +++ b/examples/declarative/demos/webbrowser/webbrowser.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 0xE1704EEA + +# 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/webbrowser/webbrowser.svg b/examples/declarative/demos/webbrowser/webbrowser.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/demos/webbrowser/webbrowser.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/examples.qmlproject b/examples/declarative/examples.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/examples.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/i18n/i18n.desktop b/examples/declarative/i18n/i18n.desktop new file mode 100644 index 0000000..8dd6e34 --- /dev/null +++ b/examples/declarative/i18n/i18n.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=i18n +Exec=/opt/usr/bin/i18n +Icon=i18n +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/i18n/i18n.png b/examples/declarative/i18n/i18n.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/i18n/i18n.png differ diff --git a/examples/declarative/i18n/i18n.pro b/examples/declarative/i18n/i18n.pro new file mode 100644 index 0000000..184feab --- /dev/null +++ b/examples/declarative/i18n/i18n.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/i18n/i18n.qmlproject b/examples/declarative/i18n/i18n.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/i18n/i18n.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* 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 0000000..566acfa --- /dev/null +++ b/examples/declarative/i18n/i18n.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/i18n/i18n/base.ts b/examples/declarative/i18n/i18n/base.ts deleted file mode 100644 index 82547a1..0000000 --- a/examples/declarative/i18n/i18n/base.ts +++ /dev/null @@ -1,12 +0,0 @@ - - - - - i18n - - - Hello - - - - diff --git a/examples/declarative/i18n/i18n/qml_en_AU.qm b/examples/declarative/i18n/i18n/qml_en_AU.qm deleted file mode 100644 index fb8b710..0000000 Binary files a/examples/declarative/i18n/i18n/qml_en_AU.qm and /dev/null differ diff --git a/examples/declarative/i18n/i18n/qml_en_AU.ts b/examples/declarative/i18n/i18n/qml_en_AU.ts deleted file mode 100644 index e991aff..0000000 --- a/examples/declarative/i18n/i18n/qml_en_AU.ts +++ /dev/null @@ -1,12 +0,0 @@ - - - - - i18n - - - Hello - G'day - - - diff --git a/examples/declarative/i18n/i18n/qml_fr.qm b/examples/declarative/i18n/i18n/qml_fr.qm deleted file mode 100644 index 583562e..0000000 Binary files a/examples/declarative/i18n/i18n/qml_fr.qm and /dev/null differ diff --git a/examples/declarative/i18n/i18n/qml_fr.ts b/examples/declarative/i18n/i18n/qml_fr.ts deleted file mode 100644 index 365abd9..0000000 --- a/examples/declarative/i18n/i18n/qml_fr.ts +++ /dev/null @@ -1,12 +0,0 @@ - - - - - i18n - - - Hello - Bonjour - - - diff --git a/examples/declarative/i18n/main.cpp b/examples/declarative/i18n/main.cpp new file mode 100644 index 0000000..66b3ffe --- /dev/null +++ b/examples/declarative/i18n/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/i18n.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/i18n/qml/i18n.qml b/examples/declarative/i18n/qml/i18n.qml new file mode 100644 index 0000000..219deda --- /dev/null +++ b/examples/declarative/i18n/qml/i18n.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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_.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.qmlproject b/examples/declarative/i18n/qml/i18n.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/i18n/qml/i18n.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/i18n/qml/i18n/base.ts b/examples/declarative/i18n/qml/i18n/base.ts new file mode 100644 index 0000000..82547a1 --- /dev/null +++ b/examples/declarative/i18n/qml/i18n/base.ts @@ -0,0 +1,12 @@ + + + + + i18n + + + Hello + + + + diff --git a/examples/declarative/i18n/qml/i18n/qml_en_AU.qm b/examples/declarative/i18n/qml/i18n/qml_en_AU.qm new file mode 100644 index 0000000..fb8b710 Binary files /dev/null and b/examples/declarative/i18n/qml/i18n/qml_en_AU.qm differ 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 0000000..e991aff --- /dev/null +++ b/examples/declarative/i18n/qml/i18n/qml_en_AU.ts @@ -0,0 +1,12 @@ + + + + + i18n + + + Hello + G'day + + + diff --git a/examples/declarative/i18n/qml/i18n/qml_fr.qm b/examples/declarative/i18n/qml/i18n/qml_fr.qm new file mode 100644 index 0000000..583562e Binary files /dev/null and b/examples/declarative/i18n/qml/i18n/qml_fr.qm differ 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 0000000..365abd9 --- /dev/null +++ b/examples/declarative/i18n/qml/i18n/qml_fr.ts @@ -0,0 +1,12 @@ + + + + + i18n + + + Hello + Bonjour + + + diff --git a/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/imageelements/borderimage/borderimage.desktop b/examples/declarative/imageelements/borderimage/borderimage.desktop new file mode 100644 index 0000000..35f4d2b --- /dev/null +++ b/examples/declarative/imageelements/borderimage/borderimage.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=borderimage +Exec=/opt/usr/bin/borderimage +Icon=borderimage +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/imageelements/borderimage/borderimage.png b/examples/declarative/imageelements/borderimage/borderimage.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/imageelements/borderimage/borderimage.png differ diff --git a/examples/declarative/imageelements/borderimage/borderimage.pro b/examples/declarative/imageelements/borderimage/borderimage.pro new file mode 100644 index 0000000..fd49676 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/borderimage.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/imageelements/borderimage/borderimage.qmlproject b/examples/declarative/imageelements/borderimage/borderimage.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/imageelements/borderimage/borderimage.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* 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 0000000..566acfa --- /dev/null +++ b/examples/declarative/imageelements/borderimage/borderimage.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/imageelements/borderimage/content/bw.png b/examples/declarative/imageelements/borderimage/content/bw.png deleted file mode 100644 index 486eaae..0000000 Binary files a/examples/declarative/imageelements/borderimage/content/bw.png and /dev/null differ diff --git a/examples/declarative/imageelements/borderimage/content/colors-round.sci b/examples/declarative/imageelements/borderimage/content/colors-round.sci deleted file mode 100644 index 506f6f5..0000000 --- a/examples/declarative/imageelements/borderimage/content/colors-round.sci +++ /dev/null @@ -1,7 +0,0 @@ -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/content/colors-stretch.sci b/examples/declarative/imageelements/borderimage/content/colors-stretch.sci deleted file mode 100644 index e4989a7..0000000 --- a/examples/declarative/imageelements/borderimage/content/colors-stretch.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left:30 -border.top:30 -border.right:30 -border.bottom:30 -source:colors.png diff --git a/examples/declarative/imageelements/borderimage/content/colors.png b/examples/declarative/imageelements/borderimage/content/colors.png deleted file mode 100644 index dfb62f3..0000000 Binary files a/examples/declarative/imageelements/borderimage/content/colors.png and /dev/null differ diff --git a/examples/declarative/imageelements/borderimage/content/shadow.png b/examples/declarative/imageelements/borderimage/content/shadow.png deleted file mode 100644 index 431af85..0000000 Binary files a/examples/declarative/imageelements/borderimage/content/shadow.png and /dev/null differ diff --git a/examples/declarative/imageelements/borderimage/main.cpp b/examples/declarative/imageelements/borderimage/main.cpp new file mode 100644 index 0000000..1cd6d0c --- /dev/null +++ b/examples/declarative/imageelements/borderimage/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/shadows.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage.qml b/examples/declarative/imageelements/borderimage/qml/borderimage.qml new file mode 100644 index 0000000..53e35f9 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qml/borderimage.qml @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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.qmlproject b/examples/declarative/imageelements/borderimage/qml/borderimage.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qml/borderimage.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/imageelements/borderimage/qml/content/MyBorderImage.qml b/examples/declarative/imageelements/borderimage/qml/content/MyBorderImage.qml new file mode 100644 index 0000000..96495cb --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qml/content/MyBorderImage.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/ShadowRectangle.qml b/examples/declarative/imageelements/borderimage/qml/content/ShadowRectangle.qml new file mode 100644 index 0000000..839ecf1 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qml/content/ShadowRectangle.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/bw.png b/examples/declarative/imageelements/borderimage/qml/content/bw.png new file mode 100644 index 0000000..486eaae Binary files /dev/null and b/examples/declarative/imageelements/borderimage/qml/content/bw.png differ diff --git a/examples/declarative/imageelements/borderimage/qml/content/colors-round.sci b/examples/declarative/imageelements/borderimage/qml/content/colors-round.sci new file mode 100644 index 0000000..506f6f5 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qml/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/content/colors-stretch.sci b/examples/declarative/imageelements/borderimage/qml/content/colors-stretch.sci new file mode 100644 index 0000000..e4989a7 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qml/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/content/colors.png b/examples/declarative/imageelements/borderimage/qml/content/colors.png new file mode 100644 index 0000000..dfb62f3 Binary files /dev/null and b/examples/declarative/imageelements/borderimage/qml/content/colors.png differ diff --git a/examples/declarative/imageelements/borderimage/qml/content/shadow.png b/examples/declarative/imageelements/borderimage/qml/content/shadow.png new file mode 100644 index 0000000..431af85 Binary files /dev/null and b/examples/declarative/imageelements/borderimage/qml/content/shadow.png differ diff --git a/examples/declarative/imageelements/borderimage/qml/shadows.qml b/examples/declarative/imageelements/borderimage/qml/shadows.qml new file mode 100644 index 0000000..d547f63 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qml/shadows.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/borderimage/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/README b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..421e6e3 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package borderimage +---------------------------- + +Comments regarding the Package + + -- Daniel Molkentin Thu, 18 Nov 2010 16:13:09 +0100 diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/changelog b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..77071e0 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +borderimage (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Daniel Molkentin Thu, 18 Nov 2010 16:13:09 +0100 diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/compat b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/control b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..4bdc93e --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/control @@ -0,0 +1,13 @@ +Source: borderimage +Section: user/hidden +Priority: optional +Maintainer: Daniel Molkentin +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: borderimage +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/copyright b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..e1c7a29 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,40 @@ +This package was debianized by Daniel Molkentin on +Thu, 18 Nov 2010 16:13:09 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU 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 General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2010, Daniel Molkentin and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/rules b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..3799b01 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/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/borderimage.sgml > borderimage.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/borderimage. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/borderimage 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/examples/declarative/imageelements/image/image.desktop b/examples/declarative/imageelements/image/image.desktop new file mode 100644 index 0000000..6103d44 --- /dev/null +++ b/examples/declarative/imageelements/image/image.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=image +Exec=/opt/usr/bin/image +Icon=image +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/imageelements/image/image.png b/examples/declarative/imageelements/image/image.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/imageelements/image/image.png differ diff --git a/examples/declarative/imageelements/image/image.pro b/examples/declarative/imageelements/image/image.pro new file mode 100644 index 0000000..c5e94cc --- /dev/null +++ b/examples/declarative/imageelements/image/image.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/imageelements/image/image.qmlproject b/examples/declarative/imageelements/image/image.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/imageelements/image/image.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* 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 0000000..566acfa --- /dev/null +++ b/examples/declarative/imageelements/image/image.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/imageelements/image/main.cpp b/examples/declarative/imageelements/image/main.cpp new file mode 100644 index 0000000..152d536 --- /dev/null +++ b/examples/declarative/imageelements/image/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/image.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/imageelements/image/qml/ImageCell.qml b/examples/declarative/imageelements/image/qml/ImageCell.qml new file mode 100644 index 0000000..e8a6c55 --- /dev/null +++ b/examples/declarative/imageelements/image/qml/ImageCell.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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.qml b/examples/declarative/imageelements/image/qml/image.qml new file mode 100644 index 0000000..f00fc18 --- /dev/null +++ b/examples/declarative/imageelements/image/qml/image.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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.qmlproject b/examples/declarative/imageelements/image/qml/image.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/imageelements/image/qml/image.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/imageelements/image/qml/qt-logo.png b/examples/declarative/imageelements/image/qml/qt-logo.png new file mode 100644 index 0000000..14ddf2a Binary files /dev/null and b/examples/declarative/imageelements/image/qml/qt-logo.png differ diff --git a/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/imageelements/image/qt-logo.png b/examples/declarative/imageelements/image/qt-logo.png deleted file mode 100644 index 14ddf2a..0000000 Binary files a/examples/declarative/imageelements/image/qt-logo.png and /dev/null differ diff --git a/examples/declarative/imageelements/imageelements.qmlproject b/examples/declarative/imageelements/imageelements.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/imageelements/imageelements.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/imageelements/shadows/main.cpp b/examples/declarative/imageelements/shadows/main.cpp new file mode 100644 index 0000000..1cd6d0c --- /dev/null +++ b/examples/declarative/imageelements/shadows/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/shadows.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/imageelements/shadows/qml/borderimage.qml b/examples/declarative/imageelements/shadows/qml/borderimage.qml new file mode 100644 index 0000000..53e35f9 --- /dev/null +++ b/examples/declarative/imageelements/shadows/qml/borderimage.qml @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/borderimage.qmlproject b/examples/declarative/imageelements/shadows/qml/borderimage.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/imageelements/shadows/qml/borderimage.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/imageelements/shadows/qml/content/MyBorderImage.qml b/examples/declarative/imageelements/shadows/qml/content/MyBorderImage.qml new file mode 100644 index 0000000..96495cb --- /dev/null +++ b/examples/declarative/imageelements/shadows/qml/content/MyBorderImage.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/ShadowRectangle.qml b/examples/declarative/imageelements/shadows/qml/content/ShadowRectangle.qml new file mode 100644 index 0000000..839ecf1 --- /dev/null +++ b/examples/declarative/imageelements/shadows/qml/content/ShadowRectangle.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/bw.png b/examples/declarative/imageelements/shadows/qml/content/bw.png new file mode 100644 index 0000000..486eaae Binary files /dev/null and b/examples/declarative/imageelements/shadows/qml/content/bw.png differ diff --git a/examples/declarative/imageelements/shadows/qml/content/colors-round.sci b/examples/declarative/imageelements/shadows/qml/content/colors-round.sci new file mode 100644 index 0000000..506f6f5 --- /dev/null +++ b/examples/declarative/imageelements/shadows/qml/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/content/colors-stretch.sci b/examples/declarative/imageelements/shadows/qml/content/colors-stretch.sci new file mode 100644 index 0000000..e4989a7 --- /dev/null +++ b/examples/declarative/imageelements/shadows/qml/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/content/colors.png b/examples/declarative/imageelements/shadows/qml/content/colors.png new file mode 100644 index 0000000..dfb62f3 Binary files /dev/null and b/examples/declarative/imageelements/shadows/qml/content/colors.png differ diff --git a/examples/declarative/imageelements/shadows/qml/content/shadow.png b/examples/declarative/imageelements/shadows/qml/content/shadow.png new file mode 100644 index 0000000..431af85 Binary files /dev/null and b/examples/declarative/imageelements/shadows/qml/content/shadow.png differ diff --git a/examples/declarative/imageelements/shadows/qml/shadows.qml b/examples/declarative/imageelements/shadows/qml/shadows.qml new file mode 100644 index 0000000..d547f63 --- /dev/null +++ b/examples/declarative/imageelements/shadows/qml/shadows.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/imageelements/shadows/shadows.desktop b/examples/declarative/imageelements/shadows/shadows.desktop new file mode 100644 index 0000000..83acea3 --- /dev/null +++ b/examples/declarative/imageelements/shadows/shadows.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=shadows +Exec=/opt/usr/bin/shadows +Icon=shadows +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/imageelements/shadows/shadows.png b/examples/declarative/imageelements/shadows/shadows.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/imageelements/shadows/shadows.png differ diff --git a/examples/declarative/imageelements/shadows/shadows.pro b/examples/declarative/imageelements/shadows/shadows.pro new file mode 100644 index 0000000..6c88896 --- /dev/null +++ b/examples/declarative/imageelements/shadows/shadows.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/imageelements/shadows/shadows.svg b/examples/declarative/imageelements/shadows/shadows.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/imageelements/shadows/shadows.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/keyinteraction/focus/Core/images/arrow.png b/examples/declarative/keyinteraction/focus/Core/images/arrow.png deleted file mode 100644 index 14978c2..0000000 Binary files a/examples/declarative/keyinteraction/focus/Core/images/arrow.png and /dev/null differ diff --git a/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png b/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png deleted file mode 100644 index 14ddf2a..0000000 Binary files a/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png and /dev/null differ diff --git a/examples/declarative/keyinteraction/focus/focus.desktop b/examples/declarative/keyinteraction/focus/focus.desktop new file mode 100644 index 0000000..68513b3 --- /dev/null +++ b/examples/declarative/keyinteraction/focus/focus.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=focus +Exec=/opt/usr/bin/focus +Icon=focus +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/keyinteraction/focus/focus.png b/examples/declarative/keyinteraction/focus/focus.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/keyinteraction/focus/focus.png differ diff --git a/examples/declarative/keyinteraction/focus/focus.pro b/examples/declarative/keyinteraction/focus/focus.pro new file mode 100644 index 0000000..db502a0 --- /dev/null +++ b/examples/declarative/keyinteraction/focus/focus.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/keyinteraction/focus/focus.qmlproject b/examples/declarative/keyinteraction/focus/focus.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/keyinteraction/focus/focus.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* 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 0000000..566acfa --- /dev/null +++ b/examples/declarative/keyinteraction/focus/focus.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/keyinteraction/focus/main.cpp b/examples/declarative/keyinteraction/focus/main.cpp new file mode 100644 index 0000000..9e5270a --- /dev/null +++ b/examples/declarative/keyinteraction/focus/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/focus.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/keyinteraction/focus/qml/Core/ContextMenu.qml b/examples/declarative/keyinteraction/focus/qml/Core/ContextMenu.qml new file mode 100644 index 0000000..79273ad --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qml/Core/ContextMenu.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/qml/Core/GridMenu.qml new file mode 100644 index 0000000..263adad --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qml/Core/GridMenu.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/Core/ListMenu.qml b/examples/declarative/keyinteraction/focus/qml/Core/ListMenu.qml new file mode 100644 index 0000000..cefc9a3 --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qml/Core/ListMenu.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/qml/Core/ListViewDelegate.qml new file mode 100644 index 0000000..7b63cd8 --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qml/Core/ListViewDelegate.qml @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/Core/images/arrow.png b/examples/declarative/keyinteraction/focus/qml/Core/images/arrow.png new file mode 100644 index 0000000..14978c2 Binary files /dev/null and b/examples/declarative/keyinteraction/focus/qml/Core/images/arrow.png differ diff --git a/examples/declarative/keyinteraction/focus/qml/Core/images/qt-logo.png b/examples/declarative/keyinteraction/focus/qml/Core/images/qt-logo.png new file mode 100644 index 0000000..14ddf2a Binary files /dev/null and b/examples/declarative/keyinteraction/focus/qml/Core/images/qt-logo.png differ diff --git a/examples/declarative/keyinteraction/focus/qml/focus.qml b/examples/declarative/keyinteraction/focus/qml/focus.qml new file mode 100644 index 0000000..e2115d8 --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qml/focus.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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: 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: "Core/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/keyinteraction/focus/qml/focus.qmlproject b/examples/declarative/keyinteraction/focus/qml/focus.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qml/focus.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/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/keyinteraction/keyinteraction.qmlproject b/examples/declarative/keyinteraction/keyinteraction.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/keyinteraction/keyinteraction.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/modelviews/Delegate/Delegate.desktop b/examples/declarative/modelviews/Delegate/Delegate.desktop new file mode 100644 index 0000000..9815ded --- /dev/null +++ b/examples/declarative/modelviews/Delegate/Delegate.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Delegate +Exec=/opt/usr/bin/Delegate +Icon=Delegate +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/Delegate/Delegate.png b/examples/declarative/modelviews/Delegate/Delegate.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/Delegate/Delegate.png differ diff --git a/examples/declarative/modelviews/Delegate/Delegate.pro b/examples/declarative/modelviews/Delegate/Delegate.pro new file mode 100644 index 0000000..1b2a7e9 --- /dev/null +++ b/examples/declarative/modelviews/Delegate/Delegate.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 0xE5FF52C0 + +# 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/Delegate/Delegate.svg b/examples/declarative/modelviews/Delegate/Delegate.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/Delegate/Delegate.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/Delegate/main.cpp b/examples/declarative/modelviews/Delegate/main.cpp new file mode 100644 index 0000000..22252ce --- /dev/null +++ b/examples/declarative/modelviews/Delegate/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/Delegate.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/Delegate/qml/Delegate.qml b/examples/declarative/modelviews/Delegate/qml/Delegate.qml new file mode 100644 index 0000000..57048f4 --- /dev/null +++ b/examples/declarative/modelviews/Delegate/qml/Delegate.qml @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/Delegate/qml/package.qmlproject b/examples/declarative/modelviews/Delegate/qml/package.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/Delegate/qml/package.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/modelviews/Delegate/qml/view.qml b/examples/declarative/modelviews/Delegate/qml/view.qml new file mode 100644 index 0000000..cbe8f06 --- /dev/null +++ b/examples/declarative/modelviews/Delegate/qml/view.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.desktop b/examples/declarative/modelviews/gridview-example/gridviewexample.desktop new file mode 100644 index 0000000..1ba59a4 --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/gridviewexample.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=gridview-example +Exec=/opt/usr/bin/gridview-example +Icon=gridview-example +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.png b/examples/declarative/modelviews/gridview-example/gridviewexample.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/gridview-example/gridviewexample.png differ diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.pro b/examples/declarative/modelviews/gridview-example/gridviewexample.pro new file mode 100644 index 0000000..61d7865 --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/gridviewexample.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.svg b/examples/declarative/modelviews/gridview-example/gridviewexample.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/gridviewexample.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/gridview-example/main.cpp b/examples/declarative/modelviews/gridview-example/main.cpp new file mode 100644 index 0000000..3cf521f --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/gridview-example.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/gridview-example/qml/gridview-example.qml b/examples/declarative/modelviews/gridview-example/qml/gridview-example.qml new file mode 100644 index 0000000..85fefda --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/qml/gridview-example.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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-example/qml/gridview.qmlproject b/examples/declarative/modelviews/gridview-example/qml/gridview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/qml/gridview.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/modelviews/gridview-example/qml/pics/AddressBook_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png new file mode 100644 index 0000000..1ab7c8e Binary files /dev/null and b/examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png differ diff --git a/examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png new file mode 100644 index 0000000..f4b8689 Binary files /dev/null and b/examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png differ diff --git a/examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png new file mode 100644 index 0000000..c76b524 Binary files /dev/null and b/examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png differ diff --git a/examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png new file mode 100644 index 0000000..58f5787 Binary files /dev/null and b/examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png differ diff --git a/examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png new file mode 100644 index 0000000..d6d84a6 Binary files /dev/null and b/examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png differ diff --git a/examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png new file mode 100644 index 0000000..0988448 Binary files /dev/null and b/examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png differ diff --git a/examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png new file mode 100644 index 0000000..52638c5 Binary files /dev/null and b/examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png differ diff --git a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/gridview/gridview.qmlproject b/examples/declarative/modelviews/gridview/gridview.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/modelviews/gridview/gridview.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/modelviews/gridview/pics/AddressBook_48.png b/examples/declarative/modelviews/gridview/pics/AddressBook_48.png deleted file mode 100644 index 1ab7c8e..0000000 Binary files a/examples/declarative/modelviews/gridview/pics/AddressBook_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png deleted file mode 100644 index f4b8689..0000000 Binary files a/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/gridview/pics/Camera_48.png b/examples/declarative/modelviews/gridview/pics/Camera_48.png deleted file mode 100644 index c76b524..0000000 Binary files a/examples/declarative/modelviews/gridview/pics/Camera_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/gridview/pics/DateBook_48.png b/examples/declarative/modelviews/gridview/pics/DateBook_48.png deleted file mode 100644 index 58f5787..0000000 Binary files a/examples/declarative/modelviews/gridview/pics/DateBook_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/gridview/pics/EMail_48.png b/examples/declarative/modelviews/gridview/pics/EMail_48.png deleted file mode 100644 index d6d84a6..0000000 Binary files a/examples/declarative/modelviews/gridview/pics/EMail_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/gridview/pics/TodoList_48.png b/examples/declarative/modelviews/gridview/pics/TodoList_48.png deleted file mode 100644 index 0988448..0000000 Binary files a/examples/declarative/modelviews/gridview/pics/TodoList_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png deleted file mode 100644 index 52638c5..0000000 Binary files a/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg deleted file mode 100644 index da5a6b1..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/content/pics/hamburger.jpg deleted file mode 100644 index d0a15be..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/hamburger.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/content/pics/lemonade.jpg deleted file mode 100644 index db445c9..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/lemonade.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/moreDown.png b/examples/declarative/modelviews/listview/content/pics/moreDown.png deleted file mode 100644 index 31a35d5..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/moreDown.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/moreUp.png b/examples/declarative/modelviews/listview/content/pics/moreUp.png deleted file mode 100644 index fefb9c9..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/moreUp.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/content/pics/pancakes.jpg deleted file mode 100644 index 60c4396..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/pancakes.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg deleted file mode 100644 index 9dce332..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop new file mode 100644 index 0000000..d056093 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=dynamiclist +Exec=/opt/usr/bin/dynamiclist +Icon=dynamiclist +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro new file mode 100644 index 0000000..39b1ad1 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/listview/dynamiclist/main.cpp b/examples/declarative/modelviews/listview/dynamiclist/main.cpp new file mode 100644 index 0000000..28cc168 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/dynamiclist.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml new file mode 100644 index 0000000..5220763 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml new file mode 100644 index 0000000..d6808a4 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/RecipesModel.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml new file mode 100644 index 0000000..6056b90 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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: " +
    +
  • 1 cup (150g) self-raising flour +
  • 1 tbs caster sugar +
  • 3/4 cup (185ml) milk +
  • 1 egg +
+ " + method: " +
    +
  1. Sift flour and sugar together into a bowl. Add a pinch of salt. +
  2. Beat milk and egg together, then add to dry ingredients. Beat until smooth. +
  3. Pour mixture into a pan on medium heat and cook until bubbles appear on the surface. +
  4. Turn over and cook other side until golden. +
+ " + } + 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: " +
    +
  • 1 onion +
  • 1 turnip +
  • 1 potato +
  • 1 carrot +
  • 1 head of celery +
  • 1 1/2 litres of water +
+ " + method: " +
    +
  1. Chop vegetables. +
  2. Boil in water until vegetables soften. +
  3. Season with salt and pepper to taste. +
+ " + } + ListElement { + title: "Hamburger" + picture: "content/pics/hamburger.jpg" + ingredients: " +
    +
  • 500g minced beef +
  • Seasoning +
  • lettuce, tomato, onion, cheese +
  • 1 hamburger bun for each burger +
+ " + method: " +
    +
  1. Mix the beef, together with seasoning, in a food processor. +
  2. Shape the beef into burgers. +
  3. Grill the burgers for about 5 mins on each side (until cooked through) +
  4. Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion. +
+ " + } + ListElement { + title: "Lemonade" + picture: "content/pics/lemonade.jpg" + ingredients: " +
    +
  • 1 cup Lemon Juice +
  • 1 cup Sugar +
  • 6 Cups of Water (2 cups warm water, 4 cups cold water) +
+ " + method: " +
    +
  1. Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves. +
  2. Pour in lemon juice, stir again, and add 4 cups of cold water. +
  3. Chill or serve over ice cubes. +
+ " + } +} diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml new file mode 100644 index 0000000..f26d775 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.png new file mode 100644 index 0000000..29d1d44 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.png differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png new file mode 100644 index 0000000..e437312 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg new file mode 100644 index 0000000..da5a6b1 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg new file mode 100644 index 0000000..d0a15be Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg new file mode 100644 index 0000000..db445c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png new file mode 100644 index 0000000..df2a147 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png new file mode 100644 index 0000000..d6f233d Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png new file mode 100644 index 0000000..31a35d5 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png new file mode 100644 index 0000000..fefb9c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg new file mode 100644 index 0000000..60c4396 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png new file mode 100644 index 0000000..40df113 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg new file mode 100644 index 0000000..9dce332 Binary files /dev/null and b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml new file mode 100644 index 0000000..f25f0fa --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/expandingdelegates.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml new file mode 100644 index 0000000..bd3d3a9 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/highlight.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml new file mode 100644 index 0000000..249c73b --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/highlightranges.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml new file mode 100644 index 0000000..58d37a3 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/listview.qmlproject b/examples/declarative/modelviews/listview/dynamiclist/qml/listview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/listview.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/modelviews/listview/dynamiclist/qml/sections.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml new file mode 100644 index 0000000..3248899 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop new file mode 100644 index 0000000..6113e00 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=expandingdelegates +Exec=/opt/usr/bin/expandingdelegates +Icon=expandingdelegates +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro new file mode 100644 index 0000000..59f0554 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/listview/expandingdelegates/main.cpp b/examples/declarative/modelviews/listview/expandingdelegates/main.cpp new file mode 100644 index 0000000..0de5247 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/expandingdelegates.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml new file mode 100644 index 0000000..5220763 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml new file mode 100644 index 0000000..d6808a4 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/RecipesModel.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml new file mode 100644 index 0000000..6056b90 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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: " +
    +
  • 1 cup (150g) self-raising flour +
  • 1 tbs caster sugar +
  • 3/4 cup (185ml) milk +
  • 1 egg +
+ " + method: " +
    +
  1. Sift flour and sugar together into a bowl. Add a pinch of salt. +
  2. Beat milk and egg together, then add to dry ingredients. Beat until smooth. +
  3. Pour mixture into a pan on medium heat and cook until bubbles appear on the surface. +
  4. Turn over and cook other side until golden. +
+ " + } + 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: " +
    +
  • 1 onion +
  • 1 turnip +
  • 1 potato +
  • 1 carrot +
  • 1 head of celery +
  • 1 1/2 litres of water +
+ " + method: " +
    +
  1. Chop vegetables. +
  2. Boil in water until vegetables soften. +
  3. Season with salt and pepper to taste. +
+ " + } + ListElement { + title: "Hamburger" + picture: "content/pics/hamburger.jpg" + ingredients: " +
    +
  • 500g minced beef +
  • Seasoning +
  • lettuce, tomato, onion, cheese +
  • 1 hamburger bun for each burger +
+ " + method: " +
    +
  1. Mix the beef, together with seasoning, in a food processor. +
  2. Shape the beef into burgers. +
  3. Grill the burgers for about 5 mins on each side (until cooked through) +
  4. Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion. +
+ " + } + ListElement { + title: "Lemonade" + picture: "content/pics/lemonade.jpg" + ingredients: " +
    +
  • 1 cup Lemon Juice +
  • 1 cup Sugar +
  • 6 Cups of Water (2 cups warm water, 4 cups cold water) +
+ " + method: " +
    +
  1. Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves. +
  2. Pour in lemon juice, stir again, and add 4 cups of cold water. +
  3. Chill or serve over ice cubes. +
+ " + } +} diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml new file mode 100644 index 0000000..f26d775 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.png new file mode 100644 index 0000000..29d1d44 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.png differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png new file mode 100644 index 0000000..e437312 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg new file mode 100644 index 0000000..da5a6b1 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg new file mode 100644 index 0000000..d0a15be Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg new file mode 100644 index 0000000..db445c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png new file mode 100644 index 0000000..df2a147 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png new file mode 100644 index 0000000..d6f233d Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png new file mode 100644 index 0000000..31a35d5 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png new file mode 100644 index 0000000..fefb9c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg new file mode 100644 index 0000000..60c4396 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png new file mode 100644 index 0000000..40df113 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg new file mode 100644 index 0000000..9dce332 Binary files /dev/null and b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml new file mode 100644 index 0000000..f25f0fa --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml new file mode 100644 index 0000000..bd3d3a9 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/highlight.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml new file mode 100644 index 0000000..249c73b --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/highlightranges.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml new file mode 100644 index 0000000..58d37a3 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/listview.qmlproject b/examples/declarative/modelviews/listview/expandingdelegates/qml/listview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/listview.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/modelviews/listview/expandingdelegates/qml/sections.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml new file mode 100644 index 0000000..3248899 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..1ceed78 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package expandingdelegates +---------------------------- + +Comments regarding the Package + + -- Daniel Molkentin Thu, 18 Nov 2010 17:28:38 +0100 diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..5161d7d --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +expandingdelegates (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Daniel Molkentin Thu, 18 Nov 2010 17:28:38 +0100 diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..6993cea --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control @@ -0,0 +1,13 @@ +Source: expandingdelegates +Section: user/hidden +Priority: optional +Maintainer: Daniel Molkentin +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: expandingdelegates +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..6185298 --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,40 @@ +This package was debianized by Daniel Molkentin on +Thu, 18 Nov 2010 17:28:38 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU 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 General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2010, Daniel Molkentin and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..96213ef --- /dev/null +++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/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/expandingdelegates.sgml > expandingdelegates.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/expandingdelegates. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/expandingdelegates 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/examples/declarative/modelviews/listview/highlight/highlight.desktop b/examples/declarative/modelviews/listview/highlight/highlight.desktop new file mode 100644 index 0000000..5348e40 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/highlight.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=highlight +Exec=/opt/usr/bin/highlight +Icon=highlight +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/listview/highlight/highlight.png b/examples/declarative/modelviews/listview/highlight/highlight.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/highlight.png differ diff --git a/examples/declarative/modelviews/listview/highlight/highlight.pro b/examples/declarative/modelviews/listview/highlight/highlight.pro new file mode 100644 index 0000000..60ae50c --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/highlight.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/listview/highlight/highlight.svg b/examples/declarative/modelviews/listview/highlight/highlight.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/highlight.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/listview/highlight/main.cpp b/examples/declarative/modelviews/listview/highlight/main.cpp new file mode 100644 index 0000000..6628a67 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); + viewer.setMainQmlFile(QLatin1String("qml/qml/highlight.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml new file mode 100644 index 0000000..5220763 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml new file mode 100644 index 0000000..d6808a4 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/RecipesModel.qml b/examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml new file mode 100644 index 0000000..6056b90 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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: " +
    +
  • 1 cup (150g) self-raising flour +
  • 1 tbs caster sugar +
  • 3/4 cup (185ml) milk +
  • 1 egg +
+ " + method: " +
    +
  1. Sift flour and sugar together into a bowl. Add a pinch of salt. +
  2. Beat milk and egg together, then add to dry ingredients. Beat until smooth. +
  3. Pour mixture into a pan on medium heat and cook until bubbles appear on the surface. +
  4. Turn over and cook other side until golden. +
+ " + } + 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: " +
    +
  • 1 onion +
  • 1 turnip +
  • 1 potato +
  • 1 carrot +
  • 1 head of celery +
  • 1 1/2 litres of water +
+ " + method: " +
    +
  1. Chop vegetables. +
  2. Boil in water until vegetables soften. +
  3. Season with salt and pepper to taste. +
+ " + } + ListElement { + title: "Hamburger" + picture: "content/pics/hamburger.jpg" + ingredients: " +
    +
  • 500g minced beef +
  • Seasoning +
  • lettuce, tomato, onion, cheese +
  • 1 hamburger bun for each burger +
+ " + method: " +
    +
  1. Mix the beef, together with seasoning, in a food processor. +
  2. Shape the beef into burgers. +
  3. Grill the burgers for about 5 mins on each side (until cooked through) +
  4. Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion. +
+ " + } + ListElement { + title: "Lemonade" + picture: "content/pics/lemonade.jpg" + ingredients: " +
    +
  • 1 cup Lemon Juice +
  • 1 cup Sugar +
  • 6 Cups of Water (2 cups warm water, 4 cups cold water) +
+ " + method: " +
    +
  1. Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves. +
  2. Pour in lemon juice, stir again, and add 4 cups of cold water. +
  3. Chill or serve over ice cubes. +
+ " + } +} diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml new file mode 100644 index 0000000..f26d775 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.png new file mode 100644 index 0000000..29d1d44 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.png differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png new file mode 100644 index 0000000..e437312 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg new file mode 100644 index 0000000..da5a6b1 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg new file mode 100644 index 0000000..d0a15be Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg new file mode 100644 index 0000000..db445c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png new file mode 100644 index 0000000..df2a147 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png new file mode 100644 index 0000000..d6f233d Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png new file mode 100644 index 0000000..31a35d5 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png new file mode 100644 index 0000000..fefb9c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg new file mode 100644 index 0000000..60c4396 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png new file mode 100644 index 0000000..40df113 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg new file mode 100644 index 0000000..9dce332 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml new file mode 100644 index 0000000..f25f0fa --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/expandingdelegates.qml b/examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml new file mode 100644 index 0000000..bd3d3a9 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight.qml new file mode 100644 index 0000000..249c73b --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/highlight.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/highlightranges.qml b/examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml new file mode 100644 index 0000000..58d37a3 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/listview.qmlproject b/examples/declarative/modelviews/listview/highlight/qml/listview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/listview.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/modelviews/listview/highlight/qml/sections.qml b/examples/declarative/modelviews/listview/highlight/qml/sections.qml new file mode 100644 index 0000000..3248899 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qml/sections.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..37e930a --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package highlight +---------------------------- + +Comments regarding the Package + + -- Daniel Molkentin Thu, 18 Nov 2010 17:33:55 +0100 diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..43e669b --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +highlight (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Daniel Molkentin Thu, 18 Nov 2010 17:33:55 +0100 diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..0ed2ce2 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control @@ -0,0 +1,13 @@ +Source: highlight +Section: user/hidden +Priority: optional +Maintainer: Daniel Molkentin +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: highlight +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..b795943 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,40 @@ +This package was debianized by Daniel Molkentin on +Thu, 18 Nov 2010 17:33:55 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU 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 General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2010, Daniel Molkentin and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..986e3ee --- /dev/null +++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/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/highlight.sgml > highlight.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/highlight. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/highlight 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/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop b/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop new file mode 100644 index 0000000..57200be --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=highlightranges +Exec=/opt/usr/bin/highlightranges +Icon=highlightranges +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.png b/examples/declarative/modelviews/listview/highlightranges/highlightranges.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/highlightranges.png differ diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro b/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro new file mode 100644 index 0000000..4dd178f --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg b/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/listview/highlightranges/main.cpp b/examples/declarative/modelviews/listview/highlightranges/main.cpp new file mode 100644 index 0000000..f77ce15 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/highlightranges.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml new file mode 100644 index 0000000..5220763 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml new file mode 100644 index 0000000..d6808a4 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/RecipesModel.qml b/examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml new file mode 100644 index 0000000..6056b90 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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: " +
    +
  • 1 cup (150g) self-raising flour +
  • 1 tbs caster sugar +
  • 3/4 cup (185ml) milk +
  • 1 egg +
+ " + method: " +
    +
  1. Sift flour and sugar together into a bowl. Add a pinch of salt. +
  2. Beat milk and egg together, then add to dry ingredients. Beat until smooth. +
  3. Pour mixture into a pan on medium heat and cook until bubbles appear on the surface. +
  4. Turn over and cook other side until golden. +
+ " + } + 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: " +
    +
  • 1 onion +
  • 1 turnip +
  • 1 potato +
  • 1 carrot +
  • 1 head of celery +
  • 1 1/2 litres of water +
+ " + method: " +
    +
  1. Chop vegetables. +
  2. Boil in water until vegetables soften. +
  3. Season with salt and pepper to taste. +
+ " + } + ListElement { + title: "Hamburger" + picture: "content/pics/hamburger.jpg" + ingredients: " +
    +
  • 500g minced beef +
  • Seasoning +
  • lettuce, tomato, onion, cheese +
  • 1 hamburger bun for each burger +
+ " + method: " +
    +
  1. Mix the beef, together with seasoning, in a food processor. +
  2. Shape the beef into burgers. +
  3. Grill the burgers for about 5 mins on each side (until cooked through) +
  4. Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion. +
+ " + } + ListElement { + title: "Lemonade" + picture: "content/pics/lemonade.jpg" + ingredients: " +
    +
  • 1 cup Lemon Juice +
  • 1 cup Sugar +
  • 6 Cups of Water (2 cups warm water, 4 cups cold water) +
+ " + method: " +
    +
  1. Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves. +
  2. Pour in lemon juice, stir again, and add 4 cups of cold water. +
  3. Chill or serve over ice cubes. +
+ " + } +} diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml new file mode 100644 index 0000000..f26d775 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.png new file mode 100644 index 0000000..29d1d44 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.png differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png new file mode 100644 index 0000000..e437312 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg new file mode 100644 index 0000000..da5a6b1 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg new file mode 100644 index 0000000..d0a15be Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg new file mode 100644 index 0000000..db445c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png new file mode 100644 index 0000000..df2a147 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png new file mode 100644 index 0000000..d6f233d Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png new file mode 100644 index 0000000..31a35d5 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png new file mode 100644 index 0000000..fefb9c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg new file mode 100644 index 0000000..60c4396 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png new file mode 100644 index 0000000..40df113 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg new file mode 100644 index 0000000..9dce332 Binary files /dev/null and b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml new file mode 100644 index 0000000..f25f0fa --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/expandingdelegates.qml b/examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml new file mode 100644 index 0000000..bd3d3a9 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/highlight.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml new file mode 100644 index 0000000..249c73b --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml new file mode 100644 index 0000000..58d37a3 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/listview.qmlproject b/examples/declarative/modelviews/listview/highlightranges/qml/listview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/listview.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/modelviews/listview/highlightranges/qml/sections.qml b/examples/declarative/modelviews/listview/highlightranges/qml/sections.qml new file mode 100644 index 0000000..3248899 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qml/sections.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/listview/listview.qmlproject b/examples/declarative/modelviews/listview/listview.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/modelviews/listview/listview.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/modelviews/listview/sections/main.cpp b/examples/declarative/modelviews/listview/sections/main.cpp new file mode 100644 index 0000000..19b2dc8 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); + viewer.setMainQmlFile(QLatin1String("qml/qml/sections.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml new file mode 100644 index 0000000..5220763 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml new file mode 100644 index 0000000..d6808a4 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/RecipesModel.qml b/examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml new file mode 100644 index 0000000..6056b90 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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: " +
    +
  • 1 cup (150g) self-raising flour +
  • 1 tbs caster sugar +
  • 3/4 cup (185ml) milk +
  • 1 egg +
+ " + method: " +
    +
  1. Sift flour and sugar together into a bowl. Add a pinch of salt. +
  2. Beat milk and egg together, then add to dry ingredients. Beat until smooth. +
  3. Pour mixture into a pan on medium heat and cook until bubbles appear on the surface. +
  4. Turn over and cook other side until golden. +
+ " + } + 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: " +
    +
  • 1 onion +
  • 1 turnip +
  • 1 potato +
  • 1 carrot +
  • 1 head of celery +
  • 1 1/2 litres of water +
+ " + method: " +
    +
  1. Chop vegetables. +
  2. Boil in water until vegetables soften. +
  3. Season with salt and pepper to taste. +
+ " + } + ListElement { + title: "Hamburger" + picture: "content/pics/hamburger.jpg" + ingredients: " +
    +
  • 500g minced beef +
  • Seasoning +
  • lettuce, tomato, onion, cheese +
  • 1 hamburger bun for each burger +
+ " + method: " +
    +
  1. Mix the beef, together with seasoning, in a food processor. +
  2. Shape the beef into burgers. +
  3. Grill the burgers for about 5 mins on each side (until cooked through) +
  4. Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion. +
+ " + } + ListElement { + title: "Lemonade" + picture: "content/pics/lemonade.jpg" + ingredients: " +
    +
  • 1 cup Lemon Juice +
  • 1 cup Sugar +
  • 6 Cups of Water (2 cups warm water, 4 cups cold water) +
+ " + method: " +
    +
  1. Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves. +
  2. Pour in lemon juice, stir again, and add 4 cups of cold water. +
  3. Chill or serve over ice cubes. +
+ " + } +} diff --git a/examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml new file mode 100644 index 0000000..f26d775 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.png new file mode 100644 index 0000000..29d1d44 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.png differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png new file mode 100644 index 0000000..e437312 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg new file mode 100644 index 0000000..da5a6b1 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg new file mode 100644 index 0000000..d0a15be Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg new file mode 100644 index 0000000..db445c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png new file mode 100644 index 0000000..df2a147 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png new file mode 100644 index 0000000..d6f233d Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png new file mode 100644 index 0000000..31a35d5 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png new file mode 100644 index 0000000..fefb9c9 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg new file mode 100644 index 0000000..60c4396 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png new file mode 100644 index 0000000..40df113 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png differ diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg new file mode 100644 index 0000000..9dce332 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg differ diff --git a/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml new file mode 100644 index 0000000..f25f0fa --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/expandingdelegates.qml b/examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml new file mode 100644 index 0000000..bd3d3a9 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/highlight.qml b/examples/declarative/modelviews/listview/sections/qml/highlight.qml new file mode 100644 index 0000000..249c73b --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/highlight.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/highlightranges.qml b/examples/declarative/modelviews/listview/sections/qml/highlightranges.qml new file mode 100644 index 0000000..58d37a3 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/highlightranges.qml @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/listview.qmlproject b/examples/declarative/modelviews/listview/sections/qml/listview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/listview.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/modelviews/listview/sections/qml/sections.qml b/examples/declarative/modelviews/listview/sections/qml/sections.qml new file mode 100644 index 0000000..3248899 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qml/sections.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/listview/sections/sections.desktop b/examples/declarative/modelviews/listview/sections/sections.desktop new file mode 100644 index 0000000..c11801e --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/sections.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=sections +Exec=/opt/usr/bin/sections +Icon=sections +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/listview/sections/sections.png b/examples/declarative/modelviews/listview/sections/sections.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/listview/sections/sections.png differ diff --git a/examples/declarative/modelviews/listview/sections/sections.pro b/examples/declarative/modelviews/listview/sections/sections.pro new file mode 100644 index 0000000..17e04f4 --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/sections.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/listview/sections/sections.svg b/examples/declarative/modelviews/listview/sections/sections.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/listview/sections/sections.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/modelviews.qmlproject b/examples/declarative/modelviews/modelviews.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/modelviews/modelviews.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/modelviews/package/package.qmlproject b/examples/declarative/modelviews/package/package.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/modelviews/package/package.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/modelviews/pathview-example/main.cpp b/examples/declarative/modelviews/pathview-example/main.cpp new file mode 100644 index 0000000..15585ab --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/qml/pathview-example.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.desktop b/examples/declarative/modelviews/pathview-example/pathviewexample.desktop new file mode 100644 index 0000000..30d29e3 --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/pathviewexample.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=pathview-example +Exec=/opt/usr/bin/pathview-example +Icon=pathview-example +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.png b/examples/declarative/modelviews/pathview-example/pathviewexample.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/pathview-example/pathviewexample.png differ diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.pro b/examples/declarative/modelviews/pathview-example/pathviewexample.pro new file mode 100644 index 0000000..60a62ad --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/pathviewexample.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.svg b/examples/declarative/modelviews/pathview-example/pathviewexample.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/pathviewexample.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/pathview-example/qml/pathview-example.qml b/examples/declarative/modelviews/pathview-example/qml/pathview-example.qml new file mode 100644 index 0000000..267c57c --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qml/pathview-example.qml @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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-example/qml/pathview.qmlproject b/examples/declarative/modelviews/pathview-example/qml/pathview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qml/pathview.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/modelviews/pathview-example/qml/pics/AddressBook_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png new file mode 100644 index 0000000..1ab7c8e Binary files /dev/null and b/examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png differ diff --git a/examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png new file mode 100644 index 0000000..f4b8689 Binary files /dev/null and b/examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png differ diff --git a/examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png new file mode 100644 index 0000000..c76b524 Binary files /dev/null and b/examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png differ diff --git a/examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png new file mode 100644 index 0000000..58f5787 Binary files /dev/null and b/examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png differ diff --git a/examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png new file mode 100644 index 0000000..d6d84a6 Binary files /dev/null and b/examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png differ diff --git a/examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png new file mode 100644 index 0000000..0988448 Binary files /dev/null and b/examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png differ diff --git a/examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png new file mode 100644 index 0000000..52638c5 Binary files /dev/null and b/examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png differ diff --git a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..0d82252 --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package pathviewexample +---------------------------- + +Comments regarding the Package + + -- Daniel Molkentin Thu, 18 Nov 2010 17:48:31 +0100 diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..ab74121 --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +pathviewexample (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Daniel Molkentin Thu, 18 Nov 2010 17:48:31 +0100 diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..c931a89 --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control @@ -0,0 +1,13 @@ +Source: pathviewexample +Section: user/hidden +Priority: optional +Maintainer: Daniel Molkentin +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: pathviewexample +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..f848d27 --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,40 @@ +This package was debianized by Daniel Molkentin on +Thu, 18 Nov 2010 17:48:31 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU 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 General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2010, Daniel Molkentin and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..c604e5d --- /dev/null +++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/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/pathviewexample.sgml > pathviewexample.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/pathviewexample. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/pathviewexample 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/examples/declarative/modelviews/pathview/pathview.qmlproject b/examples/declarative/modelviews/pathview/pathview.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/modelviews/pathview/pathview.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/modelviews/pathview/pics/AddressBook_48.png b/examples/declarative/modelviews/pathview/pics/AddressBook_48.png deleted file mode 100644 index 1ab7c8e..0000000 Binary files a/examples/declarative/modelviews/pathview/pics/AddressBook_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png deleted file mode 100644 index f4b8689..0000000 Binary files a/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/pathview/pics/Camera_48.png b/examples/declarative/modelviews/pathview/pics/Camera_48.png deleted file mode 100644 index c76b524..0000000 Binary files a/examples/declarative/modelviews/pathview/pics/Camera_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/pathview/pics/DateBook_48.png b/examples/declarative/modelviews/pathview/pics/DateBook_48.png deleted file mode 100644 index 58f5787..0000000 Binary files a/examples/declarative/modelviews/pathview/pics/DateBook_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/pathview/pics/EMail_48.png b/examples/declarative/modelviews/pathview/pics/EMail_48.png deleted file mode 100644 index d6d84a6..0000000 Binary files a/examples/declarative/modelviews/pathview/pics/EMail_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/pathview/pics/TodoList_48.png b/examples/declarative/modelviews/pathview/pics/TodoList_48.png deleted file mode 100644 index 0988448..0000000 Binary files a/examples/declarative/modelviews/pathview/pics/TodoList_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png deleted file mode 100644 index 52638c5..0000000 Binary files a/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/visualitemmodel/main.cpp b/examples/declarative/modelviews/visualitemmodel/main.cpp new file mode 100644 index 0000000..6faeec8 --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/visualitemmodel.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml new file mode 100644 index 0000000..15f2f11 --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/qml/visualitemmodel.qmlproject b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.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/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop new file mode 100644 index 0000000..ae40ec0 --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=visualitemmodel +Exec=/opt/usr/bin/visualitemmodel +Icon=visualitemmodel +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png differ diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro new file mode 100644 index 0000000..cf61323 --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* 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 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/webview/alerts.html b/examples/declarative/modelviews/webview/alerts.html deleted file mode 100644 index 82caddf..0000000 --- a/examples/declarative/modelviews/webview/alerts.html +++ /dev/null @@ -1,5 +0,0 @@ - - -

This is a web page. It fires an alert when clicked. - - diff --git a/examples/declarative/modelviews/webview/alerts/alerts.desktop b/examples/declarative/modelviews/webview/alerts/alerts.desktop new file mode 100644 index 0000000..80af9d2 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/alerts.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=alerts +Exec=/opt/usr/bin/alerts +Icon=alerts +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/webview/alerts/alerts.png b/examples/declarative/modelviews/webview/alerts/alerts.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/webview/alerts/alerts.png differ diff --git a/examples/declarative/modelviews/webview/alerts/alerts.pro b/examples/declarative/modelviews/webview/alerts/alerts.pro new file mode 100644 index 0000000..335c3a3 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/alerts.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/webview/alerts/alerts.svg b/examples/declarative/modelviews/webview/alerts/alerts.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/alerts.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/webview/alerts/main.cpp b/examples/declarative/modelviews/webview/alerts/main.cpp new file mode 100644 index 0000000..efcfb28 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/alerts.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/webview/alerts/qml/alerts.html b/examples/declarative/modelviews/webview/alerts/qml/alerts.html new file mode 100644 index 0000000..82caddf --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts.html @@ -0,0 +1,5 @@ + + +

This is a web page. It fires an alert when clicked. + + diff --git a/examples/declarative/modelviews/webview/alerts/qml/alerts.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts.qml new file mode 100644 index 0000000..4aa4a3b --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/alerts/qml/autosize.qml b/examples/declarative/modelviews/webview/alerts/qml/autosize.qml new file mode 100644 index 0000000..7e10403 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/autosize.qml @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/alerts/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml new file mode 100644 index 0000000..9a86579 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/alerts/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/map.html new file mode 100644 index 0000000..a98da54 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/map.html @@ -0,0 +1,60 @@ + + + + + + + +

+ + diff --git a/examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png new file mode 100644 index 0000000..ecc9533 Binary files /dev/null and b/examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png differ diff --git a/examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png new file mode 100644 index 0000000..5795f04 Binary files /dev/null and b/examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png differ diff --git a/examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml b/examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml new file mode 100644 index 0000000..aed0ddd --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/alerts/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml new file mode 100644 index 0000000..afc1fa9 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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:"\ + + +
OneTwoThree +
1X1X +
20X0 +
3X1X +
" +} diff --git a/examples/declarative/modelviews/webview/alerts/qml/newwindows.html b/examples/declarative/modelviews/webview/alerts/qml/newwindows.html new file mode 100644 index 0000000..f169599 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/newwindows.html @@ -0,0 +1,3 @@ +

Multiple windows...

+ +Popup! diff --git a/examples/declarative/modelviews/webview/alerts/qml/newwindows.qml b/examples/declarative/modelviews/webview/alerts/qml/newwindows.qml new file mode 100644 index 0000000..52f7a0b --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/newwindows.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/alerts/qml/webview.qmlproject b/examples/declarative/modelviews/webview/alerts/qml/webview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qml/webview.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/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/webview/autosize/autosize.desktop b/examples/declarative/modelviews/webview/autosize/autosize.desktop new file mode 100644 index 0000000..29a81c5 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/autosize.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=autosize +Exec=/opt/usr/bin/autosize +Icon=autosize +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/webview/autosize/autosize.png b/examples/declarative/modelviews/webview/autosize/autosize.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/webview/autosize/autosize.png differ diff --git a/examples/declarative/modelviews/webview/autosize/autosize.pro b/examples/declarative/modelviews/webview/autosize/autosize.pro new file mode 100644 index 0000000..a17f822 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/autosize.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/webview/autosize/autosize.svg b/examples/declarative/modelviews/webview/autosize/autosize.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/autosize.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/webview/autosize/main.cpp b/examples/declarative/modelviews/webview/autosize/main.cpp new file mode 100644 index 0000000..8c2e63a --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); + viewer.setMainQmlFile(QLatin1String("qml/qml/autosize.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/webview/autosize/qml/alerts.html b/examples/declarative/modelviews/webview/autosize/qml/alerts.html new file mode 100644 index 0000000..82caddf --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/alerts.html @@ -0,0 +1,5 @@ + + +

This is a web page. It fires an alert when clicked. + + diff --git a/examples/declarative/modelviews/webview/autosize/qml/alerts.qml b/examples/declarative/modelviews/webview/autosize/qml/alerts.qml new file mode 100644 index 0000000..4aa4a3b --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/alerts.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/qml/autosize.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize.qml new file mode 100644 index 0000000..7e10403 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize.qml @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/autosize/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml new file mode 100644 index 0000000..9a86579 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/autosize/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html new file mode 100644 index 0000000..a98da54 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html @@ -0,0 +1,60 @@ + + + + + + + +

+ + diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png new file mode 100644 index 0000000..ecc9533 Binary files /dev/null and b/examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png differ diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png new file mode 100644 index 0000000..5795f04 Binary files /dev/null and b/examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png differ diff --git a/examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml b/examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml new file mode 100644 index 0000000..aed0ddd --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/autosize/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml new file mode 100644 index 0000000..afc1fa9 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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:"\ + + +
OneTwoThree +
1X1X +
20X0 +
3X1X +
" +} diff --git a/examples/declarative/modelviews/webview/autosize/qml/newwindows.html b/examples/declarative/modelviews/webview/autosize/qml/newwindows.html new file mode 100644 index 0000000..f169599 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/newwindows.html @@ -0,0 +1,3 @@ +

Multiple windows...

+ +Popup! diff --git a/examples/declarative/modelviews/webview/autosize/qml/newwindows.qml b/examples/declarative/modelviews/webview/autosize/qml/newwindows.qml new file mode 100644 index 0000000..52f7a0b --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/newwindows.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/autosize/qml/webview.qmlproject b/examples/declarative/modelviews/webview/autosize/qml/webview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qml/webview.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/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..ba73287 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package autosize +---------------------------- + +Comments regarding the Package + + -- Daniel Molkentin Thu, 18 Nov 2010 17:21:56 +0100 diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..2939e3b --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +autosize (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Daniel Molkentin Thu, 18 Nov 2010 17:21:56 +0100 diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..22a510c --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/control @@ -0,0 +1,13 @@ +Source: autosize +Section: user/hidden +Priority: optional +Maintainer: Daniel Molkentin +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: autosize +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..afff162 --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,40 @@ +This package was debianized by Daniel Molkentin on +Thu, 18 Nov 2010 17:21:56 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU 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 General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2010, Daniel Molkentin and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..5fa637c --- /dev/null +++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/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/autosize.sgml > autosize.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/autosize. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/autosize 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/examples/declarative/modelviews/webview/content/Mapping/map.html b/examples/declarative/modelviews/webview/content/Mapping/map.html deleted file mode 100755 index a98da54..0000000 --- a/examples/declarative/modelviews/webview/content/Mapping/map.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - -
- - diff --git a/examples/declarative/modelviews/webview/content/pics/cancel.png b/examples/declarative/modelviews/webview/content/pics/cancel.png deleted file mode 100644 index ecc9533..0000000 Binary files a/examples/declarative/modelviews/webview/content/pics/cancel.png and /dev/null differ diff --git a/examples/declarative/modelviews/webview/content/pics/ok.png b/examples/declarative/modelviews/webview/content/pics/ok.png deleted file mode 100644 index 5795f04..0000000 Binary files a/examples/declarative/modelviews/webview/content/pics/ok.png and /dev/null differ diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.desktop b/examples/declarative/modelviews/webview/googlemaps/googlemaps.desktop new file mode 100644 index 0000000..99d9a79 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=googlemaps +Exec=/opt/usr/bin/googlemaps +Icon=googlemaps +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.png b/examples/declarative/modelviews/webview/googlemaps/googlemaps.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/webview/googlemaps/googlemaps.png differ diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro b/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro new file mode 100644 index 0000000..2a4c5f2 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg b/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/webview/googlemaps/main.cpp b/examples/declarative/modelviews/webview/googlemaps/main.cpp new file mode 100644 index 0000000..0cd9c4f --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/googlemaps.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/alerts.html b/examples/declarative/modelviews/webview/googlemaps/qml/alerts.html new file mode 100644 index 0000000..82caddf --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/alerts.html @@ -0,0 +1,5 @@ + + +

This is a web page. It fires an alert when clicked. + + diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml b/examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml new file mode 100644 index 0000000..4aa4a3b --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/googlemaps/qml/autosize.qml b/examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml new file mode 100644 index 0000000..7e10403 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml new file mode 100644 index 0000000..9a86579 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/content/Mapping/map.html b/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html new file mode 100644 index 0000000..a98da54 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html @@ -0,0 +1,60 @@ + + + + + + + +

+ + diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png new file mode 100644 index 0000000..ecc9533 Binary files /dev/null and b/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png differ diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png new file mode 100644 index 0000000..5795f04 Binary files /dev/null and b/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png differ diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml new file mode 100644 index 0000000..aed0ddd --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/googlemaps/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml new file mode 100644 index 0000000..afc1fa9 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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:"\ + + +
OneTwoThree +
1X1X +
20X0 +
3X1X +
" +} diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html b/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html new file mode 100644 index 0000000..f169599 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html @@ -0,0 +1,3 @@ +

Multiple windows...

+ +Popup! diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml b/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml new file mode 100644 index 0000000..52f7a0b --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/googlemaps/qml/webview.qmlproject b/examples/declarative/modelviews/webview/googlemaps/qml/webview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qml/webview.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/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..8bc7f9e --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package googlemaps +---------------------------- + +Comments regarding the Package + + -- Daniel Molkentin Thu, 18 Nov 2010 17:19:23 +0100 diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..e3e11d9 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +googlemaps (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Daniel Molkentin Thu, 18 Nov 2010 17:19:23 +0100 diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..e046e7c --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/control @@ -0,0 +1,13 @@ +Source: googlemaps +Section: user/hidden +Priority: optional +Maintainer: Daniel Molkentin +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: googlemaps +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..d800cef --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,40 @@ +This package was debianized by Daniel Molkentin on +Thu, 18 Nov 2010 17:19:23 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU 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 General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2010, Daniel Molkentin and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..de6c89a --- /dev/null +++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/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/googlemaps.sgml > googlemaps.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/googlemaps. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/googlemaps 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/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.desktop b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.desktop new file mode 100644 index 0000000..98e5949 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=inlinehtml +Exec=/opt/usr/bin/inlinehtml +Icon=inlinehtml +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png new file mode 100644 index 0000000..707d5c4 Binary files /dev/null and b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png differ diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro new file mode 100644 index 0000000..86cdd1e --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro @@ -0,0 +1,39 @@ +# Add more folders to ship with the application, here +folder_01.source = 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 = 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. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/modelviews/webview/inlinehtml/main.cpp b/examples/declarative/modelviews/webview/inlinehtml/main.cpp new file mode 100644 index 0000000..28050c1 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/main.cpp @@ -0,0 +1,14 @@ +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/qml/inlinehtml.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html b/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html new file mode 100644 index 0000000..82caddf --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html @@ -0,0 +1,5 @@ + + +

This is a web page. It fires an alert when clicked. + + diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml new file mode 100644 index 0000000..4aa4a3b --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/inlinehtml/qml/autosize.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml new file mode 100644 index 0000000..7e10403 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/inlinehtml/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml new file mode 100644 index 0000000..9a86579 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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/inlinehtml/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html new file mode 100644 index 0000000..a98da54 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html @@ -0,0 +1,60 @@ + + + + + + + +

+ + diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png new file mode 100644 index 0000000..ecc9533 Binary files /dev/null and b/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png differ diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png new file mode 100644 index 0000000..5795f04 Binary files /dev/null and b/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png differ diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml new file mode 100644 index 0000000..aed0ddd --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml new file mode 100644 index 0000000..afc1fa9 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 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:"\ + + +
OneTwoThree +
1X1X +
20X0 +
3X1X +
" +} diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html b/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html new file mode 100644 index 0000000..f169599 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html @@ -0,0 +1,3 @@ +

Multiple windows...

+ +Popup! diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml new file mode 100644 index 0000000..52f7a0b --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR 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/inlinehtml/qml/webview.qmlproject b/examples/declarative/modelviews/webview/inlinehtml/qml/webview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/webview.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/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..11bedd1 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,157 @@ +// checksum 0x28c7 version 0x2000a +/* + 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 +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +#if defined(QMLJSDEBUGGER) + +// 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 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); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_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(ScreenOrientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != ScreenOrientationAuto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); + Q_UNUSED(error) +#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 ScreenOrientationLockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case ScreenOrientationAuto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..143c17b --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x2000a +/* + 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 + +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); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..1c0c7ed --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,154 @@ +# checksum 0x3dc8 version 0x2000a +# 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 + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + DEFINES -= QMLJSDEBUGGER + } else:isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Disabling QML debugging:") + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# 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 { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + 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}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..c0dfce0 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package inlinehtml +---------------------------- + +Comments regarding the Package + + -- Daniel Molkentin Thu, 18 Nov 2010 17:20:40 +0100 diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..68a9930 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +inlinehtml (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Daniel Molkentin Thu, 18 Nov 2010 17:20:40 +0100 diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..dbb1638 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/control @@ -0,0 +1,13 @@ +Source: inlinehtml +Section: user/hidden +Priority: optional +Maintainer: Daniel Molkentin +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: inlinehtml +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..67b61f7 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,40 @@ +This package was debianized by Daniel Molkentin on +Thu, 18 Nov 2010 17:20:40 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU 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 General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2010, Daniel Molkentin and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..39509f9 --- /dev/null +++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/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. +#