From d1c1ea4c4a1fa222391b8221ada5b8bdf0054eab Mon Sep 17 00:00:00 2001 From: Damian Jansen Date: Fri, 26 Aug 2011 09:23:28 +1000 Subject: Update modelviews examples to QtQuick 2.0 Also make abstractitemmodel example compile in 5.0 and remove obsolete files. Change-Id: Ic09f3878bb0b070e0f77398599d39952758acb8f Reviewed-on: http://codereview.qt.nokia.com/3615 Reviewed-by: Qt Sanity Bot Reviewed-by: Bea Lam --- .../modelviews/Delegate/Delegate.desktop | 11 - .../declarative/modelviews/Delegate/Delegate.png | Bin 3400 -> 0 bytes .../declarative/modelviews/Delegate/Delegate.pro | 39 -- .../declarative/modelviews/Delegate/Delegate.qml | 88 ++++ .../declarative/modelviews/Delegate/Delegate.svg | 93 ----- examples/declarative/modelviews/Delegate/main.cpp | 14 - .../modelviews/Delegate/qml/Delegate.qml | 88 ---- .../declarative/modelviews/Delegate/qml/view.qml | 76 ---- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 157 -------- .../qmlapplicationviewer/qmlapplicationviewer.h | 39 -- .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ------- examples/declarative/modelviews/Delegate/view.qml | 76 ++++ .../abstractitemmodel/abstractitemmodel.pro | 2 +- .../modelviews/abstractitemmodel/main.cpp | 4 +- .../gridview-example/gridviewexample.desktop | 11 - .../gridview-example/gridviewexample.png | Bin 3400 -> 0 bytes .../gridview-example/gridviewexample.pro | 39 -- .../gridview-example/gridviewexample.svg | 93 ----- .../modelviews/gridview-example/main.cpp | 54 --- .../gridview-example/qml/gridview-example.qml | 89 ----- .../gridview-example/qml/pics/AddressBook_48.png | Bin 3350 -> 0 bytes .../gridview-example/qml/pics/AudioPlayer_48.png | Bin 3806 -> 0 bytes .../gridview-example/qml/pics/Camera_48.png | Bin 3540 -> 0 bytes .../gridview-example/qml/pics/DateBook_48.png | Bin 2610 -> 0 bytes .../gridview-example/qml/pics/EMail_48.png | Bin 3655 -> 0 bytes .../gridview-example/qml/pics/TodoList_48.png | Bin 3429 -> 0 bytes .../gridview-example/qml/pics/VideoPlayer_48.png | Bin 4151 -> 0 bytes .../qmlapplicationviewer/qmlapplicationviewer.cpp | 197 --------- .../qmlapplicationviewer/qmlapplicationviewer.h | 79 ---- .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ------- .../modelviews/gridview/gridview-example.qml | 2 +- .../modelviews/gridview/gridview.qmlproject | 16 - .../modelviews/gridview/pics/AddressBook_48.png | Bin 0 -> 3350 bytes .../modelviews/gridview/pics/AudioPlayer_48.png | Bin 0 -> 3806 bytes .../modelviews/gridview/pics/Camera_48.png | Bin 0 -> 3540 bytes .../modelviews/gridview/pics/DateBook_48.png | Bin 0 -> 2610 bytes .../modelviews/gridview/pics/EMail_48.png | Bin 0 -> 3655 bytes .../modelviews/gridview/pics/TodoList_48.png | Bin 0 -> 3429 bytes .../modelviews/gridview/pics/VideoPlayer_48.png | Bin 0 -> 4151 bytes .../modelviews/listview/content/PetsModel.qml | 2 +- .../listview/content/PressAndHoldButton.qml | 2 +- .../modelviews/listview/content/RecipesModel.qml | 2 +- .../modelviews/listview/content/TextButton.qml | 2 +- .../listview/content/pics/fruit-salad.jpg | Bin 0 -> 17952 bytes .../modelviews/listview/content/pics/hamburger.jpg | Bin 0 -> 8572 bytes .../modelviews/listview/content/pics/lemonade.jpg | Bin 0 -> 6645 bytes .../modelviews/listview/content/pics/moreDown.png | Bin 0 -> 217 bytes .../modelviews/listview/content/pics/moreUp.png | Bin 0 -> 212 bytes .../modelviews/listview/content/pics/pancakes.jpg | Bin 0 -> 9163 bytes .../listview/content/pics/vegetable-soup.jpg | Bin 0 -> 8639 bytes .../modelviews/listview/dynamiclist.qml | 2 +- .../listview/dynamiclist/dynamiclist.desktop | 11 - .../listview/dynamiclist/dynamiclist.png | Bin 3400 -> 0 bytes .../listview/dynamiclist/dynamiclist.pro | 39 -- .../listview/dynamiclist/dynamiclist.svg | 93 ----- .../modelviews/listview/dynamiclist/main.cpp | 54 --- .../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 594 -> 0 bytes .../dynamiclist/qml/content/pics/arrow-up.png | Bin 692 -> 0 bytes .../dynamiclist/qml/content/pics/fruit-salad.jpg | Bin 17952 -> 0 bytes .../dynamiclist/qml/content/pics/hamburger.jpg | Bin 8572 -> 0 bytes .../dynamiclist/qml/content/pics/lemonade.jpg | Bin 6645 -> 0 bytes .../dynamiclist/qml/content/pics/list-delete.png | Bin 831 -> 0 bytes .../dynamiclist/qml/content/pics/minus-sign.png | Bin 250 -> 0 bytes .../dynamiclist/qml/content/pics/moreDown.png | Bin 217 -> 0 bytes .../dynamiclist/qml/content/pics/moreUp.png | Bin 212 -> 0 bytes .../dynamiclist/qml/content/pics/pancakes.jpg | Bin 9163 -> 0 bytes .../dynamiclist/qml/content/pics/plus-sign.png | Bin 462 -> 0 bytes .../qml/content/pics/vegetable-soup.jpg | Bin 8639 -> 0 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/sections.qml | 87 ---- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 197 --------- .../qmlapplicationviewer/qmlapplicationviewer.h | 79 ---- .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ------- .../modelviews/listview/expandingdelegates.qml | 2 +- .../expandingdelegates/expandingdelegates.desktop | 11 - .../expandingdelegates/expandingdelegates.png | Bin 3400 -> 0 bytes .../expandingdelegates/expandingdelegates.pro | 39 -- .../expandingdelegates/expandingdelegates.svg | 93 ----- .../listview/expandingdelegates/main.cpp | 54 --- .../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 594 -> 0 bytes .../qml/content/pics/arrow-up.png | Bin 692 -> 0 bytes .../qml/content/pics/fruit-salad.jpg | Bin 17952 -> 0 bytes .../qml/content/pics/hamburger.jpg | Bin 8572 -> 0 bytes .../qml/content/pics/lemonade.jpg | Bin 6645 -> 0 bytes .../qml/content/pics/list-delete.png | Bin 831 -> 0 bytes .../qml/content/pics/minus-sign.png | Bin 250 -> 0 bytes .../qml/content/pics/moreDown.png | Bin 217 -> 0 bytes .../expandingdelegates/qml/content/pics/moreUp.png | Bin 212 -> 0 bytes .../qml/content/pics/pancakes.jpg | Bin 9163 -> 0 bytes .../qml/content/pics/plus-sign.png | Bin 462 -> 0 bytes .../qml/content/pics/vegetable-soup.jpg | Bin 8639 -> 0 bytes .../expandingdelegates/qml/dynamiclist.qml | 203 ---------- .../expandingdelegates/qml/expandingdelegates.qml | 202 ---------- .../listview/expandingdelegates/qml/highlight.qml | 99 ----- .../expandingdelegates/qml/highlightranges.qml | 122 ------ .../listview/expandingdelegates/qml/sections.qml | 87 ---- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 197 --------- .../qmlapplicationviewer/qmlapplicationviewer.h | 79 ---- .../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/listview/highlight.qml | 2 +- .../listview/highlight/highlight.desktop | 11 - .../modelviews/listview/highlight/highlight.png | Bin 3400 -> 0 bytes .../modelviews/listview/highlight/highlight.pro | 39 -- .../modelviews/listview/highlight/highlight.svg | 93 ----- .../modelviews/listview/highlight/main.cpp | 54 --- .../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 594 -> 0 bytes .../highlight/qml/content/pics/arrow-up.png | Bin 692 -> 0 bytes .../highlight/qml/content/pics/fruit-salad.jpg | Bin 17952 -> 0 bytes .../highlight/qml/content/pics/hamburger.jpg | Bin 8572 -> 0 bytes .../highlight/qml/content/pics/lemonade.jpg | Bin 6645 -> 0 bytes .../highlight/qml/content/pics/list-delete.png | Bin 831 -> 0 bytes .../highlight/qml/content/pics/minus-sign.png | Bin 250 -> 0 bytes .../highlight/qml/content/pics/moreDown.png | Bin 217 -> 0 bytes .../listview/highlight/qml/content/pics/moreUp.png | Bin 212 -> 0 bytes .../highlight/qml/content/pics/pancakes.jpg | Bin 9163 -> 0 bytes .../highlight/qml/content/pics/plus-sign.png | Bin 462 -> 0 bytes .../highlight/qml/content/pics/vegetable-soup.jpg | Bin 8639 -> 0 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 ------ .../modelviews/listview/highlight/qml/sections.qml | 87 ---- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 197 --------- .../qmlapplicationviewer/qmlapplicationviewer.h | 79 ---- .../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 ----- .../modelviews/listview/highlightranges.qml | 2 +- .../highlightranges/highlightranges.desktop | 11 - .../listview/highlightranges/highlightranges.png | Bin 3400 -> 0 bytes .../listview/highlightranges/highlightranges.pro | 39 -- .../listview/highlightranges/highlightranges.svg | 93 ----- .../modelviews/listview/highlightranges/main.cpp | 54 --- .../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 594 -> 0 bytes .../highlightranges/qml/content/pics/arrow-up.png | Bin 692 -> 0 bytes .../qml/content/pics/fruit-salad.jpg | Bin 17952 -> 0 bytes .../highlightranges/qml/content/pics/hamburger.jpg | Bin 8572 -> 0 bytes .../highlightranges/qml/content/pics/lemonade.jpg | Bin 6645 -> 0 bytes .../qml/content/pics/list-delete.png | Bin 831 -> 0 bytes .../qml/content/pics/minus-sign.png | Bin 250 -> 0 bytes .../highlightranges/qml/content/pics/moreDown.png | Bin 217 -> 0 bytes .../highlightranges/qml/content/pics/moreUp.png | Bin 212 -> 0 bytes .../highlightranges/qml/content/pics/pancakes.jpg | Bin 9163 -> 0 bytes .../highlightranges/qml/content/pics/plus-sign.png | Bin 462 -> 0 bytes .../qml/content/pics/vegetable-soup.jpg | Bin 8639 -> 0 bytes .../listview/highlightranges/qml/dynamiclist.qml | 203 ---------- .../highlightranges/qml/expandingdelegates.qml | 202 ---------- .../listview/highlightranges/qml/highlight.qml | 99 ----- .../highlightranges/qml/highlightranges.qml | 122 ------ .../listview/highlightranges/qml/sections.qml | 87 ---- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 197 --------- .../qmlapplicationviewer/qmlapplicationviewer.h | 79 ---- .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ------- .../modelviews/listview/listview.qmlproject | 16 - .../declarative/modelviews/listview/sections.qml | 2 +- .../modelviews/listview/sections/main.cpp | 54 --- .../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 594 -> 0 bytes .../sections/qml/content/pics/arrow-up.png | Bin 692 -> 0 bytes .../sections/qml/content/pics/fruit-salad.jpg | Bin 17952 -> 0 bytes .../sections/qml/content/pics/hamburger.jpg | Bin 8572 -> 0 bytes .../sections/qml/content/pics/lemonade.jpg | Bin 6645 -> 0 bytes .../sections/qml/content/pics/list-delete.png | Bin 831 -> 0 bytes .../sections/qml/content/pics/minus-sign.png | Bin 250 -> 0 bytes .../sections/qml/content/pics/moreDown.png | Bin 217 -> 0 bytes .../listview/sections/qml/content/pics/moreUp.png | Bin 212 -> 0 bytes .../sections/qml/content/pics/pancakes.jpg | Bin 9163 -> 0 bytes .../sections/qml/content/pics/plus-sign.png | Bin 462 -> 0 bytes .../sections/qml/content/pics/vegetable-soup.jpg | Bin 8639 -> 0 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 ------ .../modelviews/listview/sections/qml/sections.qml | 87 ---- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 197 --------- .../qmlapplicationviewer/qmlapplicationviewer.h | 79 ---- .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ------- .../modelviews/listview/sections/sections.desktop | 11 - .../modelviews/listview/sections/sections.png | Bin 3400 -> 0 bytes .../modelviews/listview/sections/sections.pro | 39 -- .../modelviews/listview/sections/sections.svg | 93 ----- .../declarative/modelviews/package/Delegate.qml | 2 +- .../modelviews/package/package.qmlproject | 16 - examples/declarative/modelviews/package/view.qml | 2 +- .../modelviews/parallax/content/ParallaxView.qml | 123 ++++++ .../modelviews/parallax/content/Smiley.qml | 84 ++++ .../parallax/content/pics/background.jpg | Bin 0 -> 209814 bytes .../parallax/content/pics/face-smile.png | Bin 0 -> 15408 bytes .../modelviews/parallax/content/pics/home-page.svg | 445 +++++++++++++++++++++ .../modelviews/parallax/content/pics/shadow.png | Bin 0 -> 425 bytes .../parallax/content/pics/yast-joystick.png | Bin 0 -> 2723 bytes .../modelviews/parallax/content/pics/yast-wol.png | Bin 0 -> 3769 bytes .../declarative/modelviews/parallax/parallax.qml | 12 +- .../modelviews/parallax/parallax.qmlproject | 16 - .../modelviews/parallax/pics/background.jpg | Bin 209814 -> 0 bytes .../modelviews/parallax/pics/face-smile.png | Bin 15408 -> 0 bytes .../modelviews/parallax/pics/home-page.svg | 445 --------------------- .../modelviews/parallax/pics/shadow.png | Bin 425 -> 0 bytes .../modelviews/parallax/pics/yast-joystick.png | Bin 2723 -> 0 bytes .../modelviews/parallax/pics/yast-wol.png | Bin 3769 -> 0 bytes .../modelviews/parallax/qml/ParallaxView.qml | 123 ------ .../declarative/modelviews/parallax/qml/Smiley.qml | 84 ---- .../modelviews/pathview-example/main.cpp | 54 --- .../pathview-example/pathviewexample.desktop | 11 - .../pathview-example/pathviewexample.png | Bin 3400 -> 0 bytes .../pathview-example/pathviewexample.pro | 39 -- .../pathview-example/pathviewexample.svg | 93 ----- .../pathview-example/qml/pathview-example.qml | 109 ----- .../pathview-example/qml/pics/AddressBook_48.png | Bin 3350 -> 0 bytes .../pathview-example/qml/pics/AudioPlayer_48.png | Bin 3806 -> 0 bytes .../pathview-example/qml/pics/Camera_48.png | Bin 3540 -> 0 bytes .../pathview-example/qml/pics/DateBook_48.png | Bin 2610 -> 0 bytes .../pathview-example/qml/pics/EMail_48.png | Bin 3655 -> 0 bytes .../pathview-example/qml/pics/TodoList_48.png | Bin 3429 -> 0 bytes .../pathview-example/qml/pics/VideoPlayer_48.png | Bin 4151 -> 0 bytes .../qmlapplicationviewer/qmlapplicationviewer.cpp | 197 --------- .../qmlapplicationviewer/qmlapplicationviewer.h | 79 ---- .../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-example.qml | 2 +- .../modelviews/pathview/pathview.qmlproject | 16 - .../modelviews/pathview/pics/AddressBook_48.png | Bin 0 -> 3350 bytes .../modelviews/pathview/pics/AudioPlayer_48.png | Bin 0 -> 3806 bytes .../modelviews/pathview/pics/Camera_48.png | Bin 0 -> 3540 bytes .../modelviews/pathview/pics/DateBook_48.png | Bin 0 -> 2610 bytes .../modelviews/pathview/pics/EMail_48.png | Bin 0 -> 3655 bytes .../modelviews/pathview/pics/TodoList_48.png | Bin 0 -> 3429 bytes .../modelviews/pathview/pics/VideoPlayer_48.png | Bin 0 -> 4151 bytes .../modelviews/visualitemmodel/main.cpp | 54 --- .../visualitemmodel/qml/visualitemmodel.qml | 107 ----- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 197 --------- .../qmlapplicationviewer/qmlapplicationviewer.h | 79 ---- .../qmlapplicationviewer/qmlapplicationviewer.pri | 154 ------- .../visualitemmodel/visualitemmodel.desktop | 11 - .../modelviews/visualitemmodel/visualitemmodel.png | Bin 3400 -> 0 bytes .../modelviews/visualitemmodel/visualitemmodel.pro | 39 -- .../modelviews/visualitemmodel/visualitemmodel.qml | 2 +- .../modelviews/visualitemmodel/visualitemmodel.svg | 93 ----- 275 files changed, 839 insertions(+), 12715 deletions(-) delete mode 100644 examples/declarative/modelviews/Delegate/Delegate.desktop delete mode 100644 examples/declarative/modelviews/Delegate/Delegate.png delete mode 100644 examples/declarative/modelviews/Delegate/Delegate.pro create mode 100644 examples/declarative/modelviews/Delegate/Delegate.qml delete mode 100644 examples/declarative/modelviews/Delegate/Delegate.svg delete mode 100644 examples/declarative/modelviews/Delegate/main.cpp delete mode 100644 examples/declarative/modelviews/Delegate/qml/Delegate.qml delete mode 100644 examples/declarative/modelviews/Delegate/qml/view.qml delete mode 100644 examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 examples/declarative/modelviews/Delegate/view.qml delete mode 100644 examples/declarative/modelviews/gridview-example/gridviewexample.desktop delete mode 100644 examples/declarative/modelviews/gridview-example/gridviewexample.png delete mode 100644 examples/declarative/modelviews/gridview-example/gridviewexample.pro delete mode 100644 examples/declarative/modelviews/gridview-example/gridviewexample.svg delete mode 100644 examples/declarative/modelviews/gridview-example/main.cpp delete mode 100644 examples/declarative/modelviews/gridview-example/qml/gridview-example.qml delete mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png delete mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png delete mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png delete mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png delete mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png delete mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png delete mode 100644 examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png delete mode 100644 examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/gridview/gridview.qmlproject create mode 100644 examples/declarative/modelviews/gridview/pics/AddressBook_48.png create mode 100644 examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png create mode 100644 examples/declarative/modelviews/gridview/pics/Camera_48.png create mode 100644 examples/declarative/modelviews/gridview/pics/DateBook_48.png create mode 100644 examples/declarative/modelviews/gridview/pics/EMail_48.png create mode 100644 examples/declarative/modelviews/gridview/pics/TodoList_48.png create mode 100644 examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png create mode 100644 examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg create mode 100644 examples/declarative/modelviews/listview/content/pics/hamburger.jpg create mode 100644 examples/declarative/modelviews/listview/content/pics/lemonade.jpg create mode 100644 examples/declarative/modelviews/listview/content/pics/moreDown.png create mode 100644 examples/declarative/modelviews/listview/content/pics/moreUp.png create mode 100644 examples/declarative/modelviews/listview/content/pics/pancakes.jpg create mode 100644 examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/main.cpp delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.png delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/main.cpp delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.png delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control delete mode 100644 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright delete mode 100755 examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules delete mode 100644 examples/declarative/modelviews/listview/highlight/highlight.desktop delete mode 100644 examples/declarative/modelviews/listview/highlight/highlight.png delete mode 100644 examples/declarative/modelviews/listview/highlight/highlight.pro delete mode 100644 examples/declarative/modelviews/listview/highlight/highlight.svg delete mode 100644 examples/declarative/modelviews/listview/highlight/main.cpp delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.png delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/highlight.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qml/sections.qml delete mode 100644 examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README delete mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog delete mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat delete mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control delete mode 100644 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright delete mode 100755 examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules delete mode 100644 examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop delete mode 100644 examples/declarative/modelviews/listview/highlightranges/highlightranges.png delete mode 100644 examples/declarative/modelviews/listview/highlightranges/highlightranges.pro delete mode 100644 examples/declarative/modelviews/listview/highlightranges/highlightranges.svg delete mode 100644 examples/declarative/modelviews/listview/highlightranges/main.cpp delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.png delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qml/sections.qml delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/listview/listview.qmlproject delete mode 100644 examples/declarative/modelviews/listview/sections/main.cpp delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.png delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png delete mode 100644 examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg delete mode 100644 examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qml/highlight.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qml/highlightranges.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qml/sections.qml delete mode 100644 examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/listview/sections/sections.desktop delete mode 100644 examples/declarative/modelviews/listview/sections/sections.png delete mode 100644 examples/declarative/modelviews/listview/sections/sections.pro delete mode 100644 examples/declarative/modelviews/listview/sections/sections.svg delete mode 100644 examples/declarative/modelviews/package/package.qmlproject create mode 100644 examples/declarative/modelviews/parallax/content/ParallaxView.qml create mode 100644 examples/declarative/modelviews/parallax/content/Smiley.qml create mode 100644 examples/declarative/modelviews/parallax/content/pics/background.jpg create mode 100644 examples/declarative/modelviews/parallax/content/pics/face-smile.png create mode 100644 examples/declarative/modelviews/parallax/content/pics/home-page.svg create mode 100644 examples/declarative/modelviews/parallax/content/pics/shadow.png create mode 100644 examples/declarative/modelviews/parallax/content/pics/yast-joystick.png create mode 100644 examples/declarative/modelviews/parallax/content/pics/yast-wol.png delete mode 100644 examples/declarative/modelviews/parallax/parallax.qmlproject delete mode 100644 examples/declarative/modelviews/parallax/pics/background.jpg delete mode 100644 examples/declarative/modelviews/parallax/pics/face-smile.png delete mode 100644 examples/declarative/modelviews/parallax/pics/home-page.svg delete mode 100644 examples/declarative/modelviews/parallax/pics/shadow.png delete mode 100644 examples/declarative/modelviews/parallax/pics/yast-joystick.png delete mode 100644 examples/declarative/modelviews/parallax/pics/yast-wol.png delete mode 100644 examples/declarative/modelviews/parallax/qml/ParallaxView.qml delete mode 100644 examples/declarative/modelviews/parallax/qml/Smiley.qml delete mode 100644 examples/declarative/modelviews/pathview-example/main.cpp delete mode 100644 examples/declarative/modelviews/pathview-example/pathviewexample.desktop delete mode 100644 examples/declarative/modelviews/pathview-example/pathviewexample.png delete mode 100644 examples/declarative/modelviews/pathview-example/pathviewexample.pro delete mode 100644 examples/declarative/modelviews/pathview-example/pathviewexample.svg delete mode 100644 examples/declarative/modelviews/pathview-example/qml/pathview-example.qml delete mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png delete mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png delete mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png delete mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png delete mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png delete mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png delete mode 100644 examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png delete mode 100644 examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README delete mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog delete mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat delete mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control delete mode 100644 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright delete mode 100755 examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules delete mode 100644 examples/declarative/modelviews/pathview/pathview.qmlproject create mode 100644 examples/declarative/modelviews/pathview/pics/AddressBook_48.png create mode 100644 examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png create mode 100644 examples/declarative/modelviews/pathview/pics/Camera_48.png create mode 100644 examples/declarative/modelviews/pathview/pics/DateBook_48.png create mode 100644 examples/declarative/modelviews/pathview/pics/EMail_48.png create mode 100644 examples/declarative/modelviews/pathview/pics/TodoList_48.png create mode 100644 examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png delete mode 100644 examples/declarative/modelviews/visualitemmodel/main.cpp delete mode 100644 examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml delete mode 100644 examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h delete mode 100644 examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri delete mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop delete mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.png delete mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro delete mode 100644 examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg (limited to 'examples') diff --git a/examples/declarative/modelviews/Delegate/Delegate.desktop b/examples/declarative/modelviews/Delegate/Delegate.desktop deleted file mode 100644 index 9815dedb52..0000000000 --- a/examples/declarative/modelviews/Delegate/Delegate.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/Delegate/Delegate.png and /dev/null differ diff --git a/examples/declarative/modelviews/Delegate/Delegate.pro b/examples/declarative/modelviews/Delegate/Delegate.pro deleted file mode 100644 index 1b2a7e9b63..0000000000 --- a/examples/declarative/modelviews/Delegate/Delegate.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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.qml b/examples/declarative/modelviews/Delegate/Delegate.qml new file mode 100644 index 0000000000..ef575f567f --- /dev/null +++ b/examples/declarative/modelviews/Delegate/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 2.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/Delegate.svg b/examples/declarative/modelviews/Delegate/Delegate.svg deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/Delegate/Delegate.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/modelviews/Delegate/main.cpp b/examples/declarative/modelviews/Delegate/main.cpp deleted file mode 100644 index 22252ce4a7..0000000000 --- a/examples/declarative/modelviews/Delegate/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#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 deleted file mode 100644 index 57048f4154..0000000000 --- a/examples/declarative/modelviews/Delegate/qml/Delegate.qml +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** 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/view.qml b/examples/declarative/modelviews/Delegate/qml/view.qml deleted file mode 100644 index cbe8f0689f..0000000000 --- a/examples/declarative/modelviews/Delegate/qml/view.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 11bedd1914..0000000000 --- a/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// 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 deleted file mode 100644 index 143c17b802..0000000000 --- a/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,39 +0,0 @@ -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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/Delegate/view.qml b/examples/declarative/modelviews/Delegate/view.qml new file mode 100644 index 0000000000..89fed86aa6 --- /dev/null +++ b/examples/declarative/modelviews/Delegate/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 2.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/abstractitemmodel/abstractitemmodel.pro b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro index 55e67f34e6..760a8dca55 100644 --- a/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro +++ b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro @@ -1,6 +1,6 @@ TEMPLATE = app -QT += declarative +QT += declarative qtquick1 RESOURCES += abstractitemmodel.qrc diff --git a/examples/declarative/modelviews/abstractitemmodel/main.cpp b/examples/declarative/modelviews/abstractitemmodel/main.cpp index f60c9b8fac..7f3c574178 100644 --- a/examples/declarative/modelviews/abstractitemmodel/main.cpp +++ b/examples/declarative/modelviews/abstractitemmodel/main.cpp @@ -38,8 +38,8 @@ ** ****************************************************************************/ #include "model.h" -#include -#include +#include +#include #include diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.desktop b/examples/declarative/modelviews/gridview-example/gridviewexample.desktop deleted file mode 100644 index 1ba59a4190..0000000000 --- a/examples/declarative/modelviews/gridview-example/gridviewexample.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/gridview-example/gridviewexample.png and /dev/null differ diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.pro b/examples/declarative/modelviews/gridview-example/gridviewexample.pro deleted file mode 100644 index 61d7865af2..0000000000 --- a/examples/declarative/modelviews/gridview-example/gridviewexample.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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 deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/gridview-example/gridviewexample.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/modelviews/gridview-example/main.cpp b/examples/declarative/modelviews/gridview-example/main.cpp deleted file mode 100644 index 54f49ad50d..0000000000 --- a/examples/declarative/modelviews/gridview-example/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#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 deleted file mode 100644 index 85fefda273..0000000000 --- a/examples/declarative/modelviews/gridview-example/qml/gridview-example.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** 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/pics/AddressBook_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png deleted file mode 100644 index 1ab7c8eec1..0000000000 Binary files a/examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png and /dev/null 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 deleted file mode 100644 index f4b8689f87..0000000000 Binary files a/examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png and /dev/null 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 deleted file mode 100644 index c76b524945..0000000000 Binary files a/examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png and /dev/null 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 deleted file mode 100644 index 58f5787fb8..0000000000 Binary files a/examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png and /dev/null 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 deleted file mode 100644 index d6d84a61be..0000000000 Binary files a/examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png and /dev/null 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 deleted file mode 100644 index 0988448d9b..0000000000 Binary files a/examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png and /dev/null 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 deleted file mode 100644 index 52638c50a7..0000000000 Binary files a/examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c139..0000000000 --- a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index f5b24b0199..0000000000 --- a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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-example.qml b/examples/declarative/modelviews/gridview/gridview-example.qml index 85bd2f15c1..f6bbcc3890 100644 --- a/examples/declarative/modelviews/gridview/gridview-example.qml +++ b/examples/declarative/modelviews/gridview/gridview-example.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 300; height: 400 diff --git a/examples/declarative/modelviews/gridview/gridview.qmlproject b/examples/declarative/modelviews/gridview/gridview.qmlproject deleted file mode 100644 index d4909f8685..0000000000 --- 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 new file mode 100644 index 0000000000..1ab7c8eec1 Binary files /dev/null and b/examples/declarative/modelviews/gridview/pics/AddressBook_48.png differ diff --git a/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png new file mode 100644 index 0000000000..f4b8689f87 Binary files /dev/null and b/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png differ diff --git a/examples/declarative/modelviews/gridview/pics/Camera_48.png b/examples/declarative/modelviews/gridview/pics/Camera_48.png new file mode 100644 index 0000000000..c76b524945 Binary files /dev/null and b/examples/declarative/modelviews/gridview/pics/Camera_48.png differ diff --git a/examples/declarative/modelviews/gridview/pics/DateBook_48.png b/examples/declarative/modelviews/gridview/pics/DateBook_48.png new file mode 100644 index 0000000000..58f5787fb8 Binary files /dev/null and b/examples/declarative/modelviews/gridview/pics/DateBook_48.png differ diff --git a/examples/declarative/modelviews/gridview/pics/EMail_48.png b/examples/declarative/modelviews/gridview/pics/EMail_48.png new file mode 100644 index 0000000000..d6d84a61be Binary files /dev/null and b/examples/declarative/modelviews/gridview/pics/EMail_48.png differ diff --git a/examples/declarative/modelviews/gridview/pics/TodoList_48.png b/examples/declarative/modelviews/gridview/pics/TodoList_48.png new file mode 100644 index 0000000000..0988448d9b Binary files /dev/null and b/examples/declarative/modelviews/gridview/pics/TodoList_48.png differ diff --git a/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png new file mode 100644 index 0000000000..52638c50a7 Binary files /dev/null and b/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png differ diff --git a/examples/declarative/modelviews/listview/content/PetsModel.qml b/examples/declarative/modelviews/listview/content/PetsModel.qml index d7375a73af..e55d274fa2 100644 --- a/examples/declarative/modelviews/listview/content/PetsModel.qml +++ b/examples/declarative/modelviews/listview/content/PetsModel.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 ListModel { ListElement { diff --git a/examples/declarative/modelviews/listview/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/content/PressAndHoldButton.qml index b79b5cbb25..61cb37d602 100644 --- a/examples/declarative/modelviews/listview/content/PressAndHoldButton.qml +++ b/examples/declarative/modelviews/listview/content/PressAndHoldButton.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 Image { id: container diff --git a/examples/declarative/modelviews/listview/content/RecipesModel.qml b/examples/declarative/modelviews/listview/content/RecipesModel.qml index 893d6397b3..39ae73a3ea 100644 --- a/examples/declarative/modelviews/listview/content/RecipesModel.qml +++ b/examples/declarative/modelviews/listview/content/RecipesModel.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 ListModel { ListElement { diff --git a/examples/declarative/modelviews/listview/content/TextButton.qml b/examples/declarative/modelviews/listview/content/TextButton.qml index 9eef671fad..88fe347d2e 100644 --- a/examples/declarative/modelviews/listview/content/TextButton.qml +++ b/examples/declarative/modelviews/listview/content/TextButton.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: container diff --git a/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg new file mode 100644 index 0000000000..da5a6b10a2 Binary files /dev/null and b/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg differ diff --git a/examples/declarative/modelviews/listview/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/content/pics/hamburger.jpg new file mode 100644 index 0000000000..d0a15be1bf Binary files /dev/null and b/examples/declarative/modelviews/listview/content/pics/hamburger.jpg differ diff --git a/examples/declarative/modelviews/listview/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/content/pics/lemonade.jpg new file mode 100644 index 0000000000..db445c9ac8 Binary files /dev/null and b/examples/declarative/modelviews/listview/content/pics/lemonade.jpg differ diff --git a/examples/declarative/modelviews/listview/content/pics/moreDown.png b/examples/declarative/modelviews/listview/content/pics/moreDown.png new file mode 100644 index 0000000000..31a35d5c20 Binary files /dev/null and b/examples/declarative/modelviews/listview/content/pics/moreDown.png differ diff --git a/examples/declarative/modelviews/listview/content/pics/moreUp.png b/examples/declarative/modelviews/listview/content/pics/moreUp.png new file mode 100644 index 0000000000..fefb9c9098 Binary files /dev/null and b/examples/declarative/modelviews/listview/content/pics/moreUp.png differ diff --git a/examples/declarative/modelviews/listview/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/content/pics/pancakes.jpg new file mode 100644 index 0000000000..60c439638e Binary files /dev/null and b/examples/declarative/modelviews/listview/content/pics/pancakes.jpg differ diff --git a/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg new file mode 100644 index 0000000000..9dce332041 Binary files /dev/null and b/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg differ diff --git a/examples/declarative/modelviews/listview/dynamiclist.qml b/examples/declarative/modelviews/listview/dynamiclist.qml index 350a337c05..6e4b93ac89 100644 --- a/examples/declarative/modelviews/listview/dynamiclist.qml +++ b/examples/declarative/modelviews/listview/dynamiclist.qml @@ -37,7 +37,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 import "content" // This example shows how items can be dynamically added to and removed from diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop deleted file mode 100644 index d056093dfe..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro deleted file mode 100644 index 39b1ad13d5..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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 deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/modelviews/listview/dynamiclist/main.cpp b/examples/declarative/modelviews/listview/dynamiclist/main.cpp deleted file mode 100644 index 757b1135b7..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#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 deleted file mode 100644 index 5220763813..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index d6808a49c3..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 6056b90382..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index f26d775f2c..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 29d1d4439a..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.png and /dev/null 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 deleted file mode 100644 index e437312217..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png and /dev/null 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 deleted file mode 100644 index da5a6b10a2..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg and /dev/null 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 deleted file mode 100644 index d0a15be1bf..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg and /dev/null 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 deleted file mode 100644 index db445c9ac8..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg and /dev/null 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 deleted file mode 100644 index df2a147d24..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png and /dev/null 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 deleted file mode 100644 index d6f233d739..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png and /dev/null 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 deleted file mode 100644 index 31a35d5c20..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png and /dev/null 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 deleted file mode 100644 index fefb9c9098..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png and /dev/null 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 deleted file mode 100644 index 60c439638e..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg and /dev/null 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 deleted file mode 100644 index 40df1134f8..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png and /dev/null 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 deleted file mode 100644 index 9dce332041..0000000000 Binary files a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml deleted file mode 100644 index f25f0fab23..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index bd3d3a9cd2..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 249c73b3a0..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 58d37a3787..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** 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/sections.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml deleted file mode 100644 index 32488998a2..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 411a04c139..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index f5b24b0199..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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.qml b/examples/declarative/modelviews/listview/expandingdelegates.qml index d961aba1ff..4bb42a1644 100644 --- a/examples/declarative/modelviews/listview/expandingdelegates.qml +++ b/examples/declarative/modelviews/listview/expandingdelegates.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 import "content" // This example illustrates expanding a list item to show a more detailed view. diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop deleted file mode 100644 index 6113e0004e..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro deleted file mode 100644 index 59f0554c9a..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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 deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/modelviews/listview/expandingdelegates/main.cpp b/examples/declarative/modelviews/listview/expandingdelegates/main.cpp deleted file mode 100644 index b411dff2ec..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#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 deleted file mode 100644 index 5220763813..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index d6808a49c3..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 6056b90382..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index f26d775f2c..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 29d1d4439a..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.png and /dev/null 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 deleted file mode 100644 index e437312217..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png and /dev/null 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 deleted file mode 100644 index da5a6b10a2..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg and /dev/null 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 deleted file mode 100644 index d0a15be1bf..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg and /dev/null 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 deleted file mode 100644 index db445c9ac8..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg and /dev/null 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 deleted file mode 100644 index df2a147d24..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png and /dev/null 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 deleted file mode 100644 index d6f233d739..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png and /dev/null 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 deleted file mode 100644 index 31a35d5c20..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png and /dev/null 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 deleted file mode 100644 index fefb9c9098..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png and /dev/null 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 deleted file mode 100644 index 60c439638e..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg and /dev/null 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 deleted file mode 100644 index 40df1134f8..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png and /dev/null 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 deleted file mode 100644 index 9dce332041..0000000000 Binary files a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml deleted file mode 100644 index f25f0fab23..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index bd3d3a9cd2..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 249c73b3a0..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 58d37a3787..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** 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/sections.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml deleted file mode 100644 index 32488998a2..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 411a04c139..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index f5b24b0199..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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 deleted file mode 100644 index 1ceed78db4..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 5161d7d624..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 7f8f011eb7..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6993cea518..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 6185298041..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100755 index 96213efd2b..0000000000 --- a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules +++ /dev/null @@ -1,91 +0,0 @@ -#!/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.qml b/examples/declarative/modelviews/listview/highlight.qml index e9e269f6e4..6b049bd788 100644 --- a/examples/declarative/modelviews/listview/highlight.qml +++ b/examples/declarative/modelviews/listview/highlight.qml @@ -42,7 +42,7 @@ // that uses a SpringAnimation to provide custom movement when the // highlight bar is moved between items. -import QtQuick 1.0 +import QtQuick 2.0 import "content" Rectangle { diff --git a/examples/declarative/modelviews/listview/highlight/highlight.desktop b/examples/declarative/modelviews/listview/highlight/highlight.desktop deleted file mode 100644 index 5348e40e9c..0000000000 --- a/examples/declarative/modelviews/listview/highlight/highlight.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/highlight.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/highlight/highlight.pro b/examples/declarative/modelviews/listview/highlight/highlight.pro deleted file mode 100644 index 60ae50c428..0000000000 --- a/examples/declarative/modelviews/listview/highlight/highlight.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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 deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/listview/highlight/highlight.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/modelviews/listview/highlight/main.cpp b/examples/declarative/modelviews/listview/highlight/main.cpp deleted file mode 100644 index 7b8cdf2119..0000000000 --- a/examples/declarative/modelviews/listview/highlight/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#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 deleted file mode 100644 index 5220763813..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index d6808a49c3..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 6056b90382..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index f26d775f2c..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 29d1d4439a..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.png and /dev/null 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 deleted file mode 100644 index e437312217..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png and /dev/null 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 deleted file mode 100644 index da5a6b10a2..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg and /dev/null 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 deleted file mode 100644 index d0a15be1bf..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg and /dev/null 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 deleted file mode 100644 index db445c9ac8..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg and /dev/null 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 deleted file mode 100644 index df2a147d24..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png and /dev/null 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 deleted file mode 100644 index d6f233d739..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png and /dev/null 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 deleted file mode 100644 index 31a35d5c20..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png and /dev/null 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 deleted file mode 100644 index fefb9c9098..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png and /dev/null 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 deleted file mode 100644 index 60c439638e..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg and /dev/null 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 deleted file mode 100644 index 40df1134f8..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png and /dev/null 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 deleted file mode 100644 index 9dce332041..0000000000 Binary files a/examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml deleted file mode 100644 index f25f0fab23..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index bd3d3a9cd2..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 249c73b3a0..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/highlight.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 58d37a3787..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** 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/sections.qml b/examples/declarative/modelviews/listview/highlight/qml/sections.qml deleted file mode 100644 index 32488998a2..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qml/sections.qml +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 411a04c139..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index f5b24b0199..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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 deleted file mode 100644 index 37e930ad1d..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 43e669b50d..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 7f8f011eb7..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 0ed2ce2d00..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index b795943e8a..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100755 index 986e3ee119..0000000000 --- a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules +++ /dev/null @@ -1,91 +0,0 @@ -#!/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.qml b/examples/declarative/modelviews/listview/highlightranges.qml index cad40e76bf..4c5ef2364d 100644 --- a/examples/declarative/modelviews/listview/highlightranges.qml +++ b/examples/declarative/modelviews/listview/highlightranges.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 import "content" Rectangle { diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop b/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop deleted file mode 100644 index 57200be95e..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/highlightranges.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro b/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro deleted file mode 100644 index 4dd178f83f..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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 deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/modelviews/listview/highlightranges/main.cpp b/examples/declarative/modelviews/listview/highlightranges/main.cpp deleted file mode 100644 index fad8f0cfbf..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#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 deleted file mode 100644 index 5220763813..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index d6808a49c3..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 6056b90382..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index f26d775f2c..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 29d1d4439a..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.png and /dev/null 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 deleted file mode 100644 index e437312217..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png and /dev/null 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 deleted file mode 100644 index da5a6b10a2..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg and /dev/null 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 deleted file mode 100644 index d0a15be1bf..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg and /dev/null 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 deleted file mode 100644 index db445c9ac8..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg and /dev/null 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 deleted file mode 100644 index df2a147d24..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png and /dev/null 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 deleted file mode 100644 index d6f233d739..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png and /dev/null 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 deleted file mode 100644 index 31a35d5c20..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png and /dev/null 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 deleted file mode 100644 index fefb9c9098..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png and /dev/null 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 deleted file mode 100644 index 60c439638e..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg and /dev/null 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 deleted file mode 100644 index 40df1134f8..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png and /dev/null 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 deleted file mode 100644 index 9dce332041..0000000000 Binary files a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml deleted file mode 100644 index f25f0fab23..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index bd3d3a9cd2..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 249c73b3a0..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 58d37a3787..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** 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/sections.qml b/examples/declarative/modelviews/listview/highlightranges/qml/sections.qml deleted file mode 100644 index 32488998a2..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qml/sections.qml +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 411a04c139..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index f5b24b0199..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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 d4909f8685..0000000000 --- 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.qml b/examples/declarative/modelviews/listview/sections.qml index 30c5a489fd..09e58be5d6 100644 --- a/examples/declarative/modelviews/listview/sections.qml +++ b/examples/declarative/modelviews/listview/sections.qml @@ -41,7 +41,7 @@ // This example shows how a ListView can be separated into sections using // the ListView.section attached property. -import QtQuick 1.0 +import QtQuick 2.0 //! [0] Rectangle { diff --git a/examples/declarative/modelviews/listview/sections/main.cpp b/examples/declarative/modelviews/listview/sections/main.cpp deleted file mode 100644 index 7b827c7046..0000000000 --- a/examples/declarative/modelviews/listview/sections/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#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 deleted file mode 100644 index 5220763813..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index d6808a49c3..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 6056b90382..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index f26d775f2c..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 29d1d4439a..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.png and /dev/null 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 deleted file mode 100644 index e437312217..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png and /dev/null 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 deleted file mode 100644 index da5a6b10a2..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg and /dev/null 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 deleted file mode 100644 index d0a15be1bf..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg and /dev/null 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 deleted file mode 100644 index db445c9ac8..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg and /dev/null 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 deleted file mode 100644 index df2a147d24..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png and /dev/null 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 deleted file mode 100644 index d6f233d739..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png and /dev/null 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 deleted file mode 100644 index 31a35d5c20..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png and /dev/null 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 deleted file mode 100644 index fefb9c9098..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png and /dev/null 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 deleted file mode 100644 index 60c439638e..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg and /dev/null 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 deleted file mode 100644 index 40df1134f8..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png and /dev/null 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 deleted file mode 100644 index 9dce332041..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml deleted file mode 100644 index f25f0fab23..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index bd3d3a9cd2..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 249c73b3a0..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/highlight.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 58d37a3787..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/highlightranges.qml +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** 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/sections.qml b/examples/declarative/modelviews/listview/sections/qml/sections.qml deleted file mode 100644 index 32488998a2..0000000000 --- a/examples/declarative/modelviews/listview/sections/qml/sections.qml +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 411a04c139..0000000000 --- a/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index f5b24b0199..0000000000 --- a/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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 deleted file mode 100644 index c11801e623..0000000000 --- a/examples/declarative/modelviews/listview/sections/sections.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/listview/sections/sections.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/sections/sections.pro b/examples/declarative/modelviews/listview/sections/sections.pro deleted file mode 100644 index 17e04f4aa5..0000000000 --- a/examples/declarative/modelviews/listview/sections/sections.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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 deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/listview/sections/sections.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/modelviews/package/Delegate.qml b/examples/declarative/modelviews/package/Delegate.qml index 24abc5de75..ae1dffb63b 100644 --- a/examples/declarative/modelviews/package/Delegate.qml +++ b/examples/declarative/modelviews/package/Delegate.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 //![0] Package { diff --git a/examples/declarative/modelviews/package/package.qmlproject b/examples/declarative/modelviews/package/package.qmlproject deleted file mode 100644 index d4909f8685..0000000000 --- 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/package/view.qml b/examples/declarative/modelviews/package/view.qml index 1715ba1dfd..7adbb80fc7 100644 --- a/examples/declarative/modelviews/package/view.qml +++ b/examples/declarative/modelviews/package/view.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { color: "white" diff --git a/examples/declarative/modelviews/parallax/content/ParallaxView.qml b/examples/declarative/modelviews/parallax/content/ParallaxView.qml new file mode 100644 index 0000000000..287358250a --- /dev/null +++ b/examples/declarative/modelviews/parallax/content/ParallaxView.qml @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: root + + property alias background: background.source + property int currentIndex: 0 + default property alias content: visualModel.children + + Image { + id: background + fillMode: Image.TileHorizontally + x: -list.contentX / 2 + width: Math.max(list.contentWidth, parent.width) + } + + ListView { + id: list + anchors.fill: parent + + currentIndex: root.currentIndex + onCurrentIndexChanged: root.currentIndex = currentIndex + + orientation: Qt.Horizontal + boundsBehavior: Flickable.DragOverBounds + model: VisualItemModel { id: visualModel } + + highlightRangeMode: ListView.StrictlyEnforceRange + snapMode: ListView.SnapOneItem + } + + ListView { + id: selector + + height: 50 + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + width: Math.min(count * 50, parent.width - 20) + interactive: width == parent.width - 20 + orientation: Qt.Horizontal + + currentIndex: root.currentIndex + onCurrentIndexChanged: root.currentIndex = currentIndex + + model: visualModel.children + delegate: Item { + width: 50; height: 50 + id: delegateRoot + + Image { + id: image + source: modelData.icon + smooth: true + scale: 0.8 + } + + MouseArea { + anchors.fill: parent + onClicked: { root.currentIndex = index } + } + + states: State { + name: "Selected" + when: delegateRoot.ListView.isCurrentItem == true + PropertyChanges { + target: image + scale: 1 + y: -5 + } + } + transitions: Transition { + NumberAnimation { properties: "scale,y" } + } + } + + Rectangle { + color: "#60FFFFFF" + x: -10; y: -10; z: -1 + width: parent.width + 20; height: parent.height + 20 + radius: 10 + } + } +} diff --git a/examples/declarative/modelviews/parallax/content/Smiley.qml b/examples/declarative/modelviews/parallax/content/Smiley.qml new file mode 100644 index 0000000000..9538a99a57 --- /dev/null +++ b/examples/declarative/modelviews/parallax/content/Smiley.qml @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +// This is taken from the declarative animation/basics/property-animation.qml +// example + +Item { + id: window + width: 320; height: 480 + + Image { + anchors.horizontalCenter: parent.horizontalCenter + y: smiley.minHeight + 58 + source: "pics/shadow.png" + + scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) + } + + Image { + id: smiley + property int maxHeight: window.height / 3 + property int minHeight: 2 * window.height / 3 + + anchors.horizontalCenter: parent.horizontalCenter + y: minHeight + source: "pics/face-smile.png" + + SequentialAnimation on y { + loops: Animation.Infinite + + NumberAnimation { + from: smiley.minHeight; to: smiley.maxHeight + easing.type: Easing.OutExpo; duration: 300 + } + + NumberAnimation { + from: smiley.maxHeight; to: smiley.minHeight + easing.type: Easing.OutBounce; duration: 1000 + } + + PauseAnimation { duration: 500 } + } + } +} + diff --git a/examples/declarative/modelviews/parallax/content/pics/background.jpg b/examples/declarative/modelviews/parallax/content/pics/background.jpg new file mode 100644 index 0000000000..61cca2f138 Binary files /dev/null and b/examples/declarative/modelviews/parallax/content/pics/background.jpg differ diff --git a/examples/declarative/modelviews/parallax/content/pics/face-smile.png b/examples/declarative/modelviews/parallax/content/pics/face-smile.png new file mode 100644 index 0000000000..3d66d72578 Binary files /dev/null and b/examples/declarative/modelviews/parallax/content/pics/face-smile.png differ diff --git a/examples/declarative/modelviews/parallax/content/pics/home-page.svg b/examples/declarative/modelviews/parallax/content/pics/home-page.svg new file mode 100644 index 0000000000..4f16958844 --- /dev/null +++ b/examples/declarative/modelviews/parallax/content/pics/home-page.svg @@ -0,0 +1,445 @@ + +image/svg+xmlGo HomeJakub Steinerhttp://jimmac.musichall.czhomereturngodefaultuserdirectoryTuomas Kuosmanen + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/declarative/modelviews/parallax/content/pics/shadow.png b/examples/declarative/modelviews/parallax/content/pics/shadow.png new file mode 100644 index 0000000000..8270565e87 Binary files /dev/null and b/examples/declarative/modelviews/parallax/content/pics/shadow.png differ diff --git a/examples/declarative/modelviews/parallax/content/pics/yast-joystick.png b/examples/declarative/modelviews/parallax/content/pics/yast-joystick.png new file mode 100644 index 0000000000..858cea0301 Binary files /dev/null and b/examples/declarative/modelviews/parallax/content/pics/yast-joystick.png differ diff --git a/examples/declarative/modelviews/parallax/content/pics/yast-wol.png b/examples/declarative/modelviews/parallax/content/pics/yast-wol.png new file mode 100644 index 0000000000..7712180a3b Binary files /dev/null and b/examples/declarative/modelviews/parallax/content/pics/yast-wol.png differ diff --git a/examples/declarative/modelviews/parallax/parallax.qml b/examples/declarative/modelviews/parallax/parallax.qml index 0fdc5e3345..93181c667e 100644 --- a/examples/declarative/modelviews/parallax/parallax.qml +++ b/examples/declarative/modelviews/parallax/parallax.qml @@ -38,9 +38,9 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 import "../../toys/clocks/content" // for loading the Clock element -import "qml" +import "content" Rectangle { width: 320; height: 480 @@ -48,22 +48,22 @@ Rectangle { ParallaxView { id: parallax anchors.fill: parent - background: "pics/background.jpg" + background: "content/pics/background.jpg" Item { - property url icon: "pics/yast-wol.png" + property url icon: "content/pics/yast-wol.png" width: 320; height: 480 Clock { anchors.centerIn: parent } } Item { - property url icon: "pics/home-page.svg" + property url icon: "content/pics/home-page.svg" width: 320; height: 480 Smiley { } } Item { - property url icon: "pics/yast-joystick.png" + property url icon: "content/pics/yast-joystick.png" width: 320; height: 480 Loader { diff --git a/examples/declarative/modelviews/parallax/parallax.qmlproject b/examples/declarative/modelviews/parallax/parallax.qmlproject deleted file mode 100644 index d4909f8685..0000000000 --- a/examples/declarative/modelviews/parallax/parallax.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/parallax/pics/background.jpg b/examples/declarative/modelviews/parallax/pics/background.jpg deleted file mode 100644 index 61cca2f138..0000000000 Binary files a/examples/declarative/modelviews/parallax/pics/background.jpg and /dev/null differ diff --git a/examples/declarative/modelviews/parallax/pics/face-smile.png b/examples/declarative/modelviews/parallax/pics/face-smile.png deleted file mode 100644 index 3d66d72578..0000000000 Binary files a/examples/declarative/modelviews/parallax/pics/face-smile.png and /dev/null differ diff --git a/examples/declarative/modelviews/parallax/pics/home-page.svg b/examples/declarative/modelviews/parallax/pics/home-page.svg deleted file mode 100644 index 4f16958844..0000000000 --- a/examples/declarative/modelviews/parallax/pics/home-page.svg +++ /dev/null @@ -1,445 +0,0 @@ - -image/svg+xmlGo HomeJakub Steinerhttp://jimmac.musichall.czhomereturngodefaultuserdirectoryTuomas Kuosmanen - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/declarative/modelviews/parallax/pics/shadow.png b/examples/declarative/modelviews/parallax/pics/shadow.png deleted file mode 100644 index 8270565e87..0000000000 Binary files a/examples/declarative/modelviews/parallax/pics/shadow.png and /dev/null differ diff --git a/examples/declarative/modelviews/parallax/pics/yast-joystick.png b/examples/declarative/modelviews/parallax/pics/yast-joystick.png deleted file mode 100644 index 858cea0301..0000000000 Binary files a/examples/declarative/modelviews/parallax/pics/yast-joystick.png and /dev/null differ diff --git a/examples/declarative/modelviews/parallax/pics/yast-wol.png b/examples/declarative/modelviews/parallax/pics/yast-wol.png deleted file mode 100644 index 7712180a3b..0000000000 Binary files a/examples/declarative/modelviews/parallax/pics/yast-wol.png and /dev/null differ diff --git a/examples/declarative/modelviews/parallax/qml/ParallaxView.qml b/examples/declarative/modelviews/parallax/qml/ParallaxView.qml deleted file mode 100644 index 9ad636fad6..0000000000 --- a/examples/declarative/modelviews/parallax/qml/ParallaxView.qml +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: root - - property alias background: background.source - property int currentIndex: 0 - default property alias content: visualModel.children - - Image { - id: background - fillMode: Image.TileHorizontally - x: -list.contentX / 2 - width: Math.max(list.contentWidth, parent.width) - } - - ListView { - id: list - anchors.fill: parent - - currentIndex: root.currentIndex - onCurrentIndexChanged: root.currentIndex = currentIndex - - orientation: Qt.Horizontal - boundsBehavior: Flickable.DragOverBounds - model: VisualItemModel { id: visualModel } - - highlightRangeMode: ListView.StrictlyEnforceRange - snapMode: ListView.SnapOneItem - } - - ListView { - id: selector - - height: 50 - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - width: Math.min(count * 50, parent.width - 20) - interactive: width == parent.width - 20 - orientation: Qt.Horizontal - - currentIndex: root.currentIndex - onCurrentIndexChanged: root.currentIndex = currentIndex - - model: visualModel.children - delegate: Item { - width: 50; height: 50 - id: delegateRoot - - Image { - id: image - source: modelData.icon - smooth: true - scale: 0.8 - } - - MouseArea { - anchors.fill: parent - onClicked: { root.currentIndex = index } - } - - states: State { - name: "Selected" - when: delegateRoot.ListView.isCurrentItem == true - PropertyChanges { - target: image - scale: 1 - y: -5 - } - } - transitions: Transition { - NumberAnimation { properties: "scale,y" } - } - } - - Rectangle { - color: "#60FFFFFF" - x: -10; y: -10; z: -1 - width: parent.width + 20; height: parent.height + 20 - radius: 10 - } - } -} diff --git a/examples/declarative/modelviews/parallax/qml/Smiley.qml b/examples/declarative/modelviews/parallax/qml/Smiley.qml deleted file mode 100644 index c964f50dd9..0000000000 --- a/examples/declarative/modelviews/parallax/qml/Smiley.qml +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -// This is taken from the declarative animation/basics/property-animation.qml -// example - -Item { - id: window - width: 320; height: 480 - - Image { - anchors.horizontalCenter: parent.horizontalCenter - y: smiley.minHeight + 58 - source: "../pics/shadow.png" - - scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) - } - - Image { - id: smiley - property int maxHeight: window.height / 3 - property int minHeight: 2 * window.height / 3 - - anchors.horizontalCenter: parent.horizontalCenter - y: minHeight - source: "../pics/face-smile.png" - - SequentialAnimation on y { - loops: Animation.Infinite - - NumberAnimation { - from: smiley.minHeight; to: smiley.maxHeight - easing.type: Easing.OutExpo; duration: 300 - } - - NumberAnimation { - from: smiley.maxHeight; to: smiley.minHeight - easing.type: Easing.OutBounce; duration: 1000 - } - - PauseAnimation { duration: 500 } - } - } -} - diff --git a/examples/declarative/modelviews/pathview-example/main.cpp b/examples/declarative/modelviews/pathview-example/main.cpp deleted file mode 100644 index 85d682d896..0000000000 --- a/examples/declarative/modelviews/pathview-example/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#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 deleted file mode 100644 index 30d29e3242..0000000000 --- a/examples/declarative/modelviews/pathview-example/pathviewexample.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/pathview-example/pathviewexample.png and /dev/null differ diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.pro b/examples/declarative/modelviews/pathview-example/pathviewexample.pro deleted file mode 100644 index 60a62ad532..0000000000 --- a/examples/declarative/modelviews/pathview-example/pathviewexample.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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 deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/pathview-example/pathviewexample.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - 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 deleted file mode 100644 index 267c57c869..0000000000 --- a/examples/declarative/modelviews/pathview-example/qml/pathview-example.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** 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/pics/AddressBook_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png deleted file mode 100644 index 1ab7c8eec1..0000000000 Binary files a/examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png and /dev/null 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 deleted file mode 100644 index f4b8689f87..0000000000 Binary files a/examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png and /dev/null 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 deleted file mode 100644 index c76b524945..0000000000 Binary files a/examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png and /dev/null 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 deleted file mode 100644 index 58f5787fb8..0000000000 Binary files a/examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png and /dev/null 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 deleted file mode 100644 index d6d84a61be..0000000000 Binary files a/examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png and /dev/null 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 deleted file mode 100644 index 0988448d9b..0000000000 Binary files a/examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png and /dev/null 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 deleted file mode 100644 index 52638c50a7..0000000000 Binary files a/examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png and /dev/null differ diff --git a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c139..0000000000 --- a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index f5b24b0199..0000000000 --- a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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 deleted file mode 100644 index 0d8225202e..0000000000 --- a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index ab74121717..0000000000 --- a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 7f8f011eb7..0000000000 --- a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c931a891f2..0000000000 --- a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index f848d27ec1..0000000000 --- a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100755 index c604e5dc1f..0000000000 --- a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules +++ /dev/null @@ -1,91 +0,0 @@ -#!/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-example.qml b/examples/declarative/modelviews/pathview/pathview-example.qml index bddab8fd3d..40b413f3ac 100644 --- a/examples/declarative/modelviews/pathview/pathview-example.qml +++ b/examples/declarative/modelviews/pathview/pathview-example.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400; height: 240 diff --git a/examples/declarative/modelviews/pathview/pathview.qmlproject b/examples/declarative/modelviews/pathview/pathview.qmlproject deleted file mode 100644 index d4909f8685..0000000000 --- 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 new file mode 100644 index 0000000000..1ab7c8eec1 Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/AddressBook_48.png differ diff --git a/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png new file mode 100644 index 0000000000..f4b8689f87 Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png differ diff --git a/examples/declarative/modelviews/pathview/pics/Camera_48.png b/examples/declarative/modelviews/pathview/pics/Camera_48.png new file mode 100644 index 0000000000..c76b524945 Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/Camera_48.png differ diff --git a/examples/declarative/modelviews/pathview/pics/DateBook_48.png b/examples/declarative/modelviews/pathview/pics/DateBook_48.png new file mode 100644 index 0000000000..58f5787fb8 Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/DateBook_48.png differ diff --git a/examples/declarative/modelviews/pathview/pics/EMail_48.png b/examples/declarative/modelviews/pathview/pics/EMail_48.png new file mode 100644 index 0000000000..d6d84a61be Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/EMail_48.png differ diff --git a/examples/declarative/modelviews/pathview/pics/TodoList_48.png b/examples/declarative/modelviews/pathview/pics/TodoList_48.png new file mode 100644 index 0000000000..0988448d9b Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/TodoList_48.png differ diff --git a/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png new file mode 100644 index 0000000000..52638c50a7 Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png differ diff --git a/examples/declarative/modelviews/visualitemmodel/main.cpp b/examples/declarative/modelviews/visualitemmodel/main.cpp deleted file mode 100644 index 1b265025e6..0000000000 --- a/examples/declarative/modelviews/visualitemmodel/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#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 deleted file mode 100644 index 15f2f1152c..0000000000 --- a/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** 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/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c139..0000000000 --- a/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index f5b24b0199..0000000000 --- a/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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 deleted file mode 100644 index 1c0c7edb39..0000000000 --- a/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# 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 deleted file mode 100644 index ae40ec030f..0000000000 --- a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 707d5c4e85..0000000000 Binary files a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png and /dev/null differ diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro deleted file mode 100644 index cf61323bd3..0000000000 --- a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro +++ /dev/null @@ -1,39 +0,0 @@ -# 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.qml b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qml index 4ea7e5b0c8..977ed24935 100644 --- a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qml +++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qml @@ -41,7 +41,7 @@ // This example demonstrates placing items in a view using // a VisualItemModel -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { color: "lightgray" diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg deleted file mode 100644 index 566acfada0..0000000000 --- a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - -- cgit v1.2.3