diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/animation/animation.qmlproject (renamed from examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/animation/basics/basics.qmlproject (renamed from examples/declarative/xmldata/xmldata.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/animation/basics/color-animation.qml (renamed from examples/declarative/animations/color-animation.qml) | 5 | ||||
-rw-r--r-- | examples/declarative/animation/basics/images/face-smile.png (renamed from examples/declarative/parallax/pics/face-smile.png) | bin | 15408 -> 15408 bytes | |||
-rw-r--r-- | examples/declarative/animation/basics/images/moon.png (renamed from examples/declarative/animations/images/moon.png) | bin | 2433 -> 2433 bytes | |||
-rw-r--r-- | examples/declarative/animation/basics/images/shadow.png (renamed from examples/declarative/parallax/pics/shadow.png) | bin | 425 -> 425 bytes | |||
-rw-r--r-- | examples/declarative/animation/basics/images/star.png (renamed from examples/declarative/dynamic/images/star.png) | bin | 349 -> 349 bytes | |||
-rw-r--r-- | examples/declarative/animation/basics/images/sun.png (renamed from examples/declarative/dynamic/images/sun.png) | bin | 8153 -> 8153 bytes | |||
-rw-r--r-- | examples/declarative/animation/basics/property-animation.qml (renamed from examples/declarative/animations/property-animation.qml) | 5 | ||||
-rw-r--r-- | examples/declarative/animation/behaviors/SideRect.qml (renamed from examples/declarative/behaviors/SideRect.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/animation/behaviors/behavior-example.qml (renamed from examples/declarative/behaviors/behavior-example.qml) | 4 | ||||
-rw-r--r-- | examples/declarative/animation/behaviors/behaviors.qmlproject (renamed from examples/declarative/behaviors/behaviors.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/animation/easing/easing.qml | 105 | ||||
-rw-r--r-- | examples/declarative/animation/easing/easing.qmlproject (renamed from examples/declarative/workerscript/workerscript.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/animation/states/states.qml (renamed from examples/declarative/states/states.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/animation/states/states.qmlproject (renamed from examples/declarative/states/states.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/animation/states/transitions.qml (renamed from examples/declarative/states/transitions.qml) | 4 | ||||
-rw-r--r-- | examples/declarative/animation/states/user.png (renamed from examples/declarative/states/user.png) | bin | 4886 -> 4886 bytes | |||
-rw-r--r-- | examples/declarative/animations/easing.qml | 99 | ||||
-rw-r--r-- | examples/declarative/border-image/animated.qml | 54 | ||||
-rw-r--r-- | examples/declarative/border-image/borders.qml | 17 | ||||
-rw-r--r-- | examples/declarative/border-image/content/MyBorderImage.qml | 37 | ||||
-rw-r--r-- | examples/declarative/connections/connections-example.qml | 38 | ||||
-rw-r--r-- | examples/declarative/connections/content/Button.qml | 12 | ||||
-rw-r--r-- | examples/declarative/connections/content/bg1.jpg | bin | 23771 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/connections/content/rotate-left.png | bin | 3061 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/connections/content/rotate-right.png | bin | 3115 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/cppextensions/cppextensions.pro | 10 | ||||
-rw-r--r-- | examples/declarative/cppextensions/cppextensions.qmlproject (renamed from examples/declarative/webview/webview.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir (renamed from examples/declarative/imageprovider/ImageProviderCore/qmldir) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/imageprovider/imageprovider-example.qml (renamed from examples/declarative/imageprovider/imageprovider-example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/imageprovider/imageprovider.cpp (renamed from examples/declarative/imageprovider/imageprovider.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/imageprovider/imageprovider.pro (renamed from examples/declarative/imageprovider/imageprovider.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject (renamed from examples/declarative/imageprovider/imageprovider.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/plugins/README (renamed from examples/declarative/plugins/README) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml (renamed from examples/declarative/plugins/com/nokia/TimeExample/Clock.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png (renamed from examples/declarative/plugins/com/nokia/TimeExample/center.png) | bin | 765 -> 765 bytes | |||
-rw-r--r-- | examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png (renamed from examples/declarative/plugins/com/nokia/TimeExample/clock.png) | bin | 20653 -> 20653 bytes | |||
-rw-r--r-- | examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png (renamed from examples/declarative/plugins/com/nokia/TimeExample/hour.png) | bin | 625 -> 625 bytes | |||
-rw-r--r-- | examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png (renamed from examples/declarative/plugins/com/nokia/TimeExample/minute.png) | bin | 625 -> 625 bytes | |||
-rw-r--r-- | examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir (renamed from examples/declarative/plugins/com/nokia/TimeExample/qmldir) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/plugins/plugin.cpp (renamed from examples/declarative/plugins/plugin.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/plugins/plugins.pro (renamed from examples/declarative/plugins/plugins.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/plugins/plugins.qml (renamed from examples/declarative/plugins/plugins.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/plugins/plugins.qmlproject (renamed from examples/declarative/plugins/plugins.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxyviewer/main.cpp | 109 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxyviewer/proxyviewer.pro | 9 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc (renamed from examples/declarative/stringlistmodel/stringlistmodel.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxyviewer/view.qml | 7 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir (renamed from examples/declarative/proxywidgets/ProxyWidgets/qmldir) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxywidgets/README (renamed from examples/declarative/proxywidgets/README) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp (renamed from examples/declarative/proxywidgets/proxywidgets.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxywidgets/proxywidgets.pro (renamed from examples/declarative/proxywidgets/proxywidgets.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxywidgets/proxywidgets.qml (renamed from examples/declarative/proxywidgets/proxywidgets.qml) | 2 | ||||
-rw-r--r-- | examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject (renamed from examples/declarative/proxywidgets/proxywidgets.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicsLayouts.pro | 13 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.cpp | 366 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml | 77 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qrc | 5 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts_p.h | 303 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/main.cpp | 60 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro | 13 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml | 15 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qrc | 5 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp | 73 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro | 5 | ||||
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject (renamed from examples/declarative/velocity/velocity.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/adding/adding.pro (renamed from examples/declarative/extending/adding/adding.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/adding/adding.qrc (renamed from examples/declarative/extending/adding/adding.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/adding/example.qml (renamed from examples/declarative/extending/adding/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/adding/main.cpp (renamed from examples/declarative/extending/adding/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/adding/person.cpp (renamed from examples/declarative/extending/adding/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/adding/person.h (renamed from examples/declarative/extending/adding/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/attached/attached.pro (renamed from examples/declarative/extending/attached/attached.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/attached/attached.qrc (renamed from examples/declarative/extending/attached/attached.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp (renamed from examples/declarative/extending/attached/birthdayparty.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h (renamed from examples/declarative/extending/attached/birthdayparty.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/attached/example.qml (renamed from examples/declarative/extending/attached/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/attached/main.cpp (renamed from examples/declarative/extending/attached/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/attached/person.cpp (renamed from examples/declarative/extending/valuesource/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/attached/person.h (renamed from examples/declarative/extending/valuesource/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/binding.pro (renamed from examples/declarative/extending/binding/binding.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/binding.qrc (renamed from examples/declarative/extending/binding/binding.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp (renamed from examples/declarative/extending/binding/birthdayparty.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h (renamed from examples/declarative/extending/binding/birthdayparty.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/example.qml (renamed from examples/declarative/extending/binding/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp (renamed from examples/declarative/extending/binding/happybirthdaysong.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h (renamed from examples/declarative/extending/binding/happybirthdaysong.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/main.cpp (renamed from examples/declarative/extending/binding/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/person.cpp (renamed from examples/declarative/extending/binding/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/binding/person.h (renamed from examples/declarative/extending/binding/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp (renamed from examples/declarative/extending/grouped/birthdayparty.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h (renamed from examples/declarative/extending/coercion/birthdayparty.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro (renamed from examples/declarative/extending/coercion/coercion.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc (renamed from examples/declarative/extending/coercion/coercion.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/coercion/example.qml (renamed from examples/declarative/extending/coercion/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/coercion/main.cpp (renamed from examples/declarative/extending/coercion/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/coercion/person.cpp (renamed from examples/declarative/extending/coercion/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/coercion/person.h (renamed from examples/declarative/extending/coercion/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp (renamed from examples/declarative/extending/default/birthdayparty.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h (renamed from examples/declarative/extending/default/birthdayparty.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/default/default.pro (renamed from examples/declarative/extending/default/default.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/default/default.qrc (renamed from examples/declarative/extending/default/default.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/default/example.qml (renamed from examples/declarative/extending/default/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/default/main.cpp (renamed from examples/declarative/extending/default/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/default/person.cpp (renamed from examples/declarative/extending/default/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/default/person.h (renamed from examples/declarative/extending/default/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/extended/example.qml (renamed from examples/declarative/extending/extended/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/extended/extended.pro (renamed from examples/declarative/extending/extended/extended.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/extended/extended.qrc (renamed from examples/declarative/extending/extended/extended.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp (renamed from examples/declarative/extending/extended/lineedit.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/extended/lineedit.h (renamed from examples/declarative/extending/extended/lineedit.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/extended/main.cpp (renamed from examples/declarative/extending/extended/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp (renamed from examples/declarative/extending/coercion/birthdayparty.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h (renamed from examples/declarative/extending/grouped/birthdayparty.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/grouped/example.qml (renamed from examples/declarative/extending/grouped/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro (renamed from examples/declarative/extending/grouped/grouped.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc (renamed from examples/declarative/extending/grouped/grouped.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/grouped/main.cpp (renamed from examples/declarative/extending/grouped/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/grouped/person.cpp (renamed from examples/declarative/extending/signal/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/grouped/person.h (renamed from examples/declarative/extending/grouped/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp (renamed from examples/declarative/extending/properties/birthdayparty.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h (renamed from examples/declarative/extending/properties/birthdayparty.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/properties/example.qml (renamed from examples/declarative/extending/properties/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/properties/main.cpp (renamed from examples/declarative/extending/properties/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/properties/person.cpp (renamed from examples/declarative/extending/properties/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/properties/person.h (renamed from examples/declarative/extending/properties/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/properties/properties.pro (renamed from examples/declarative/extending/properties/properties.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/properties/properties.qrc (renamed from examples/declarative/extending/properties/properties.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/referenceexamples.pro (renamed from examples/declarative/extending/extending.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject (renamed from examples/declarative/tvtennis/tvtennis.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp (renamed from examples/declarative/extending/signal/birthdayparty.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h (renamed from examples/declarative/extending/signal/birthdayparty.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/signal/example.qml (renamed from examples/declarative/extending/signal/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/signal/main.cpp (renamed from examples/declarative/extending/signal/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/signal/person.cpp (renamed from examples/declarative/extending/grouped/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/signal/person.h (renamed from examples/declarative/extending/signal/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/signal/signal.pro (renamed from examples/declarative/extending/signal/signal.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/signal/signal.qrc (renamed from examples/declarative/extending/signal/signal.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp (renamed from examples/declarative/extending/valuesource/birthdayparty.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h (renamed from examples/declarative/extending/valuesource/birthdayparty.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/example.qml (renamed from examples/declarative/extending/valuesource/example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp (renamed from examples/declarative/extending/valuesource/happybirthdaysong.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h (renamed from examples/declarative/extending/valuesource/happybirthdaysong.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp (renamed from examples/declarative/extending/valuesource/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp (renamed from examples/declarative/extending/attached/person.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/person.h (renamed from examples/declarative/extending/attached/person.h) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro (renamed from examples/declarative/extending/valuesource/valuesource.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc (renamed from examples/declarative/extending/valuesource/valuesource.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/declarative.pro | 57 | ||||
-rw-r--r-- | examples/declarative/dynamic/dynamic.qml | 157 | ||||
-rw-r--r-- | examples/declarative/dynamic/qml/Button.qml | 24 | ||||
-rw-r--r-- | examples/declarative/dynamic/qml/GenericItem.qml | 13 | ||||
-rw-r--r-- | examples/declarative/dynamic/qml/PaletteItem.qml | 13 | ||||
-rw-r--r-- | examples/declarative/dynamic/qml/PerspectiveItem.qml | 16 | ||||
-rw-r--r-- | examples/declarative/dynamic/qml/Sun.qml | 24 | ||||
-rw-r--r-- | examples/declarative/dynamic/qml/itemCreation.js | 82 | ||||
-rw-r--r-- | examples/declarative/fillmode/content/QtLogo.qml | 30 | ||||
-rw-r--r-- | examples/declarative/fillmode/content/qt-logo.png | bin | 5149 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/fillmode/fillmode.qml | 22 | ||||
-rw-r--r-- | examples/declarative/i18n/i18n.qml | 37 | ||||
-rw-r--r-- | examples/declarative/i18n/i18n.qmlproject (renamed from examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/i18n/i18n/base.ts | 12 | ||||
-rw-r--r-- | examples/declarative/i18n/i18n/qml_en_AU.qm | bin | 0 -> 81 bytes | |||
-rw-r--r-- | examples/declarative/i18n/i18n/qml_en_AU.ts | 12 | ||||
-rw-r--r-- | examples/declarative/i18n/i18n/qml_fr.qm | bin | 0 -> 85 bytes | |||
-rw-r--r-- | examples/declarative/i18n/i18n/qml_fr.ts | 12 | ||||
-rw-r--r-- | examples/declarative/imageelements/borderimage/borderimage.qml | 57 | ||||
-rw-r--r-- | examples/declarative/imageelements/borderimage/borderimage.qmlproject (renamed from examples/declarative/tabwidget/tabwidget.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/borderimage/content/MyBorderImage.qml | 50 | ||||
-rw-r--r-- | examples/declarative/imageelements/borderimage/content/ShadowRectangle.qml | 14 | ||||
-rw-r--r-- | examples/declarative/imageelements/borderimage/content/bw.png (renamed from examples/declarative/border-image/content/bw.png) | bin | 1357 -> 1357 bytes | |||
-rw-r--r-- | examples/declarative/imageelements/borderimage/content/colors-round.sci (renamed from examples/declarative/border-image/content/colors-round.sci) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/borderimage/content/colors-stretch.sci (renamed from examples/declarative/border-image/content/colors-stretch.sci) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/borderimage/content/colors.png (renamed from examples/declarative/border-image/content/colors.png) | bin | 1655 -> 1655 bytes | |||
-rw-r--r-- | examples/declarative/imageelements/borderimage/content/shadow.png | bin | 0 -> 588 bytes | |||
-rw-r--r-- | examples/declarative/imageelements/borderimage/shadows.qml | 24 | ||||
-rw-r--r-- | examples/declarative/imageelements/image/face_fit.qml (renamed from examples/declarative/aspectratio/face_fit.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/image/face_fit_animated.qml (renamed from examples/declarative/aspectratio/face_fit_animated.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/image/image.qmlproject (renamed from examples/declarative/sql/sql.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/image/pics/face.png (renamed from examples/declarative/aspectratio/pics/face.png) | bin | 15408 -> 15408 bytes | |||
-rw-r--r-- | examples/declarative/imageelements/image/scale_and_crop.qml (renamed from examples/declarative/aspectratio/scale_and_crop.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/image/scale_and_crop_simple.qml (renamed from examples/declarative/aspectratio/scale_and_crop_simple.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/image/scale_and_sidecrop.qml (renamed from examples/declarative/aspectratio/scale_and_sidecrop.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/image/scale_to_fit.qml (renamed from examples/declarative/aspectratio/scale_to_fit.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/image/scale_to_fit_simple.qml (renamed from examples/declarative/aspectratio/scale_to_fit_simple.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/imageelements/imageelements.qmlproject (renamed from examples/declarative/slideswitch/slideswitch.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/images/content/lemonade.jpg | bin | 6645 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/images/images.qml | 72 | ||||
-rw-r--r-- | examples/declarative/keyinteraction/focus/Core/ContextMenu.qml (renamed from examples/declarative/focus/Core/ContextMenu.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/keyinteraction/focus/Core/GridMenu.qml (renamed from examples/declarative/focus/Core/GridMenu.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml (renamed from examples/declarative/focus/Core/ListViewDelegate.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/keyinteraction/focus/Core/ListViews.qml (renamed from examples/declarative/focus/Core/ListViews.qml) | 6 | ||||
-rw-r--r-- | examples/declarative/keyinteraction/focus/Core/images/arrow.png (renamed from examples/declarative/focus/Core/images/arrow.png) | bin | 583 -> 583 bytes | |||
-rw-r--r-- | examples/declarative/keyinteraction/focus/Core/images/qt-logo.png (renamed from examples/declarative/focus/Core/images/qt-logo.png) | bin | 5149 -> 5149 bytes | |||
-rw-r--r-- | examples/declarative/keyinteraction/focus/Core/qmldir (renamed from examples/declarative/focus/Core/qmldir) | 0 | ||||
-rw-r--r-- | examples/declarative/keyinteraction/focus/focus.qml (renamed from examples/declarative/focus/focus.qml) | 4 | ||||
-rw-r--r-- | examples/declarative/keyinteraction/focus/focus.qmlproject (renamed from examples/declarative/focus/focus.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/keyinteraction/keyinteraction.qmlproject (renamed from examples/declarative/searchbox/searchbox.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/layouts/Button.qml | 22 | ||||
-rw-r--r-- | examples/declarative/layouts/layouts.qml | 29 | ||||
-rw-r--r-- | examples/declarative/modelviews/gridview/gridview-example.qml (renamed from examples/declarative/gridview/gridview-example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/gridview/gridview.qmlproject (renamed from examples/declarative/gridview/gridview.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/gridview/pics/AddressBook_48.png (renamed from examples/declarative/gridview/pics/AddressBook_48.png) | bin | 3350 -> 3350 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png (renamed from examples/declarative/gridview/pics/AudioPlayer_48.png) | bin | 3806 -> 3806 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/gridview/pics/Camera_48.png (renamed from examples/declarative/gridview/pics/Camera_48.png) | bin | 3540 -> 3540 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/gridview/pics/DateBook_48.png (renamed from examples/declarative/gridview/pics/DateBook_48.png) | bin | 2610 -> 2610 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/gridview/pics/EMail_48.png (renamed from examples/declarative/gridview/pics/EMail_48.png) | bin | 3655 -> 3655 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/gridview/pics/TodoList_48.png (renamed from examples/declarative/gridview/pics/TodoList_48.png) | bin | 3429 -> 3429 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png (renamed from examples/declarative/gridview/pics/VideoPlayer_48.png) | bin | 4151 -> 4151 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml (renamed from examples/declarative/listview/content/ClickAutoRepeating.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/content/MediaButton.qml (renamed from examples/declarative/listview/content/MediaButton.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/add.png (renamed from examples/declarative/listview/content/pics/add.png) | bin | 1577 -> 1577 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/archive-insert.png (renamed from examples/declarative/listview/content/pics/archive-insert.png) | bin | 896 -> 896 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/archive-remove.png (renamed from examples/declarative/listview/content/pics/archive-remove.png) | bin | 1074 -> 1074 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/button-pressed.png (renamed from examples/declarative/listview/content/pics/button-pressed.png) | bin | 571 -> 571 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/button.png (renamed from examples/declarative/listview/content/pics/button.png) | bin | 564 -> 564 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/del.png (renamed from examples/declarative/listview/content/pics/del.png) | bin | 1661 -> 1661 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg (renamed from examples/declarative/listview/content/pics/fruit-salad.jpg) | bin | 17952 -> 17952 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/go-down.png (renamed from examples/declarative/listview/content/pics/go-down.png) | bin | 892 -> 892 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/go-up.png (renamed from examples/declarative/listview/content/pics/go-up.png) | bin | 929 -> 929 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/hamburger.jpg (renamed from examples/declarative/listview/content/pics/hamburger.jpg) | bin | 8572 -> 8572 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/lemonade.jpg (renamed from examples/declarative/listview/content/pics/lemonade.jpg) | bin | 6645 -> 6645 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/list-add.png (renamed from examples/declarative/listview/content/pics/list-add.png) | bin | 907 -> 907 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/list-remove.png (renamed from examples/declarative/listview/content/pics/list-remove.png) | bin | 498 -> 498 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/moreDown.png (renamed from examples/declarative/listview/content/pics/moreDown.png) | bin | 217 -> 217 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/moreUp.png (renamed from examples/declarative/listview/content/pics/moreUp.png) | bin | 212 -> 212 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/pancakes.jpg (renamed from examples/declarative/listview/content/pics/pancakes.jpg) | bin | 9163 -> 9163 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/trash.png (renamed from examples/declarative/listview/content/pics/trash.png) | bin | 989 -> 989 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg (renamed from examples/declarative/listview/content/pics/vegetable-soup.jpg) | bin | 8639 -> 8639 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml (renamed from examples/declarative/listview/dummydata/MyPetsModel.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/dummydata/Recipes.qml (renamed from examples/declarative/listview/dummydata/Recipes.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/dynamic.qml (renamed from examples/declarative/listview/dynamic.qml) | 22 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/highlight.qml (renamed from examples/declarative/listview/highlight.qml) | 2 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/itemlist.qml (renamed from examples/declarative/listview/itemlist.qml) | 4 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/listview-example.qml (renamed from examples/declarative/listview/listview-example.qml) | 4 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/listview.qmlproject (renamed from examples/declarative/listview/listview.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/recipes.qml (renamed from examples/declarative/listview/recipes.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/sections.qml (renamed from examples/declarative/listview/sections.qml) | 2 | ||||
-rw-r--r-- | examples/declarative/modelviews/modelviews.pro | 7 | ||||
-rw-r--r-- | examples/declarative/modelviews/modelviews.qmlproject (renamed from examples/declarative/scrollbar/scrollbar.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/objectlistmodel/dataobject.cpp (renamed from examples/declarative/objectlistmodel/dataobject.cpp) | 10 | ||||
-rw-r--r-- | examples/declarative/modelviews/objectlistmodel/dataobject.h (renamed from examples/declarative/objectlistmodel/dataobject.h) | 8 | ||||
-rw-r--r-- | examples/declarative/modelviews/objectlistmodel/main.cpp (renamed from examples/declarative/objectlistmodel/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro (renamed from examples/declarative/objectlistmodel/objectlistmodel.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject (renamed from examples/declarative/objectlistmodel/objectlistmodel.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/objectlistmodel/objectlistmodel.qrc (renamed from examples/declarative/objectlistmodel/objectlistmodel.qrc) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/objectlistmodel/view.qml (renamed from examples/declarative/objectlistmodel/view.qml) | 2 | ||||
-rw-r--r-- | examples/declarative/modelviews/package/Delegate.qml (renamed from examples/declarative/package/Delegate.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/package/package.qmlproject (renamed from examples/declarative/package/package.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/package/view.qml (renamed from examples/declarative/package/view.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/parallax/parallax.qml (renamed from examples/declarative/parallax/parallax.qml) | 6 | ||||
-rw-r--r-- | examples/declarative/modelviews/parallax/parallax.qmlproject (renamed from examples/declarative/parallax/parallax.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/parallax/pics/background.jpg (renamed from examples/declarative/parallax/pics/background.jpg) | bin | 209814 -> 209814 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/parallax/pics/face-smile.png (renamed from examples/declarative/dynamic/images/face-smile.png) | bin | 15408 -> 15408 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/parallax/pics/home-page.svg (renamed from examples/declarative/parallax/pics/home-page.svg) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/parallax/pics/shadow.png (renamed from examples/declarative/animations/images/shadow.png) | bin | 425 -> 425 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/parallax/pics/yast-joystick.png (renamed from examples/declarative/parallax/pics/yast-joystick.png) | bin | 2723 -> 2723 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/parallax/pics/yast-wol.png (renamed from examples/declarative/parallax/pics/yast-wol.png) | bin | 3769 -> 3769 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/parallax/qml/ParallaxView.qml (renamed from examples/declarative/parallax/qml/ParallaxView.qml) | 15 | ||||
-rw-r--r-- | examples/declarative/modelviews/parallax/qml/Smiley.qml (renamed from examples/declarative/parallax/qml/Smiley.qml) | 7 | ||||
-rw-r--r-- | examples/declarative/modelviews/stringlistmodel/main.cpp (renamed from examples/declarative/stringlistmodel/main.cpp) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro (renamed from examples/declarative/stringlistmodel/stringlistmodel.pro) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/stringlistmodel/stringlistmodel.qrc | 5 | ||||
-rw-r--r-- | examples/declarative/modelviews/stringlistmodel/view.qml (renamed from examples/declarative/stringlistmodel/view.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/alerts.html (renamed from examples/declarative/webview/alerts.html) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/alerts.qml (renamed from examples/declarative/webview/alerts.qml) | 2 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/autosize.qml (renamed from examples/declarative/webview/autosize.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/content/FieldText.qml (renamed from examples/declarative/webview/content/FieldText.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/content/Mapping/Map.qml (renamed from examples/declarative/webview/content/Mapping/Map.qml) | 0 | ||||
-rwxr-xr-x | examples/declarative/modelviews/webview/content/Mapping/map.html (renamed from examples/declarative/webview/content/Mapping/map.html) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/content/SpinSquare.qml (renamed from examples/declarative/webview/content/SpinSquare.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/content/pics/cancel.png (renamed from examples/declarative/webview/content/pics/cancel.png) | bin | 1038 -> 1038 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/webview/content/pics/ok.png (renamed from examples/declarative/webview/content/pics/ok.png) | bin | 655 -> 655 bytes | |||
-rw-r--r-- | examples/declarative/modelviews/webview/googleMaps.qml (renamed from examples/declarative/webview/googleMaps.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/inline-html.qml (renamed from examples/declarative/webview/inline-html.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/newwindows.html (renamed from examples/declarative/webview/newwindows.html) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/newwindows.qml (renamed from examples/declarative/webview/newwindows.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/transparent.qml (renamed from examples/declarative/webview/transparent.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/modelviews/webview/webview.qmlproject (renamed from examples/declarative/progressbar/progressbar.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/positioners/Button.qml | 38 | ||||
-rw-r--r-- | examples/declarative/positioners/add.png (renamed from examples/declarative/layouts/add.png) | bin | 1577 -> 1577 bytes | |||
-rw-r--r-- | examples/declarative/positioners/del.png (renamed from examples/declarative/layouts/del.png) | bin | 1661 -> 1661 bytes | |||
-rw-r--r-- | examples/declarative/positioners/positioners.qml (renamed from examples/declarative/layouts/positioners.qml) | 16 | ||||
-rw-r--r-- | examples/declarative/positioners/positioners.qmlproject | 18 | ||||
-rw-r--r-- | examples/declarative/positioners/positioners.qmlproject.user | 41 | ||||
-rw-r--r-- | examples/declarative/scrollbar/ScrollBar.qml | 33 | ||||
-rw-r--r-- | examples/declarative/sqllocalstorage/hello.qml (renamed from examples/declarative/sql/hello.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject (renamed from examples/declarative/mousearea/mousearea.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/text/fonts/availableFonts.qml | 17 | ||||
-rw-r--r-- | examples/declarative/text/fonts/banner.qml (renamed from examples/declarative/fonts/banner.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/text/fonts/fonts.qml (renamed from examples/declarative/fonts/fonts.qml) | 6 | ||||
-rw-r--r-- | examples/declarative/text/fonts/fonts.qmlproject (renamed from examples/declarative/fonts/fonts.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf (renamed from examples/declarative/fonts/fonts/tarzeau_ocr_a.ttf) | bin | 24544 -> 24544 bytes | |||
-rw-r--r-- | examples/declarative/text/fonts/hello.qml (renamed from examples/declarative/fonts/hello.qml) | 2 | ||||
-rw-r--r-- | examples/declarative/text/text.qmlproject (renamed from examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/threading/threadedlistmodel/dataloader.js (renamed from examples/declarative/listmodel-threaded/dataloader.js) | 0 | ||||
-rw-r--r-- | examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject (renamed from examples/declarative/layouts/layouts.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/threading/threadedlistmodel/timedisplay.qml (renamed from examples/declarative/listmodel-threaded/timedisplay.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/threading/threading.qmlproject (renamed from examples/declarative/images/images.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/threading/workerscript/workerscript.js (renamed from examples/declarative/workerscript/workerscript.js) | 0 | ||||
-rw-r--r-- | examples/declarative/threading/workerscript/workerscript.qml (renamed from examples/declarative/workerscript/workerscript.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/threading/workerscript/workerscript.qmlproject (renamed from examples/declarative/gestures/gestures.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/touchinteraction/gestures/experimental-gestures.qml (renamed from examples/declarative/gestures/experimental-gestures.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/touchinteraction/gestures/gestures.qmlproject (renamed from examples/declarative/flipable/flipable.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/touchinteraction/mousearea/mouse.qml (renamed from examples/declarative/mousearea/mouse.qml) | 2 | ||||
-rw-r--r-- | examples/declarative/touchinteraction/mousearea/mousearea.qmlproject (renamed from examples/declarative/fillmode/fillmode.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/touchinteraction/touchinteraction.qmlproject (renamed from examples/declarative/extending/extending.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/clocks/clocks.qml (renamed from examples/declarative/clocks/clocks.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/clocks/clocks.qmlproject (renamed from examples/declarative/clocks/clocks.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/clocks/content/Clock.qml (renamed from examples/declarative/clocks/content/Clock.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/clocks/content/background.png (renamed from examples/declarative/clocks/content/background.png) | bin | 46895 -> 46895 bytes | |||
-rwxr-xr-x | examples/declarative/toys/clocks/content/center.png (renamed from examples/declarative/clocks/content/center.png) | bin | 765 -> 765 bytes | |||
-rwxr-xr-x | examples/declarative/toys/clocks/content/clock-night.png (renamed from examples/declarative/clocks/content/clock-night.png) | bin | 23359 -> 23359 bytes | |||
-rwxr-xr-x | examples/declarative/toys/clocks/content/clock.png (renamed from examples/declarative/clocks/content/clock.png) | bin | 20653 -> 20653 bytes | |||
-rwxr-xr-x | examples/declarative/toys/clocks/content/hour.png (renamed from examples/declarative/clocks/content/hour.png) | bin | 625 -> 625 bytes | |||
-rwxr-xr-x | examples/declarative/toys/clocks/content/minute.png (renamed from examples/declarative/clocks/content/minute.png) | bin | 625 -> 625 bytes | |||
-rwxr-xr-x | examples/declarative/toys/clocks/content/second.png (renamed from examples/declarative/clocks/content/second.png) | bin | 303 -> 303 bytes | |||
-rw-r--r-- | examples/declarative/toys/dial/content/Dial.qml (renamed from examples/declarative/dial/content/Dial.qml) | 6 | ||||
-rw-r--r-- | examples/declarative/toys/dial/content/background.png (renamed from examples/declarative/dial/content/background.png) | bin | 35876 -> 35876 bytes | |||
-rw-r--r-- | examples/declarative/toys/dial/content/needle.png (renamed from examples/declarative/dial/content/needle.png) | bin | 342 -> 342 bytes | |||
-rw-r--r-- | examples/declarative/toys/dial/content/needle_shadow.png (renamed from examples/declarative/dial/content/needle_shadow.png) | bin | 632 -> 632 bytes | |||
-rw-r--r-- | examples/declarative/toys/dial/content/overlay.png (renamed from examples/declarative/dial/content/overlay.png) | bin | 3564 -> 3564 bytes | |||
-rw-r--r-- | examples/declarative/toys/dial/dial-example.qml (renamed from examples/declarative/dial/dial-example.qml) | 10 | ||||
-rw-r--r-- | examples/declarative/toys/dial/dial.qmlproject (renamed from examples/declarative/dial/dial.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/dynamic/dynamic.qml | 176 | ||||
-rw-r--r-- | examples/declarative/toys/dynamic/dynamic.qmlproject (renamed from examples/declarative/dynamic/dynamic.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/dynamic/images/NOTE (renamed from examples/declarative/dynamic/images/NOTE) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/dynamic/images/face-smile.png (renamed from examples/declarative/animations/images/face-smile.png) | bin | 15408 -> 15408 bytes | |||
-rw-r--r-- | examples/declarative/toys/dynamic/images/moon.png (renamed from examples/declarative/dynamic/images/moon.png) | bin | 1757 -> 1757 bytes | |||
-rw-r--r-- | examples/declarative/toys/dynamic/images/rabbit_brown.png (renamed from examples/declarative/dynamic/images/rabbit_brown.png) | bin | 1245 -> 1245 bytes | |||
-rw-r--r-- | examples/declarative/toys/dynamic/images/rabbit_bw.png (renamed from examples/declarative/dynamic/images/rabbit_bw.png) | bin | 1759 -> 1759 bytes | |||
-rw-r--r-- | examples/declarative/toys/dynamic/images/star.png (renamed from examples/declarative/animations/images/star.png) | bin | 349 -> 349 bytes | |||
-rw-r--r-- | examples/declarative/toys/dynamic/images/sun.png (renamed from examples/declarative/animations/images/sun.png) | bin | 8153 -> 8153 bytes | |||
-rw-r--r-- | examples/declarative/toys/dynamic/images/tree_s.png (renamed from examples/declarative/dynamic/images/tree_s.png) | bin | 3406 -> 3406 bytes | |||
-rw-r--r-- | examples/declarative/toys/dynamic/qml/Button.qml | 40 | ||||
-rw-r--r-- | examples/declarative/toys/dynamic/qml/PaletteItem.qml | 19 | ||||
-rw-r--r-- | examples/declarative/toys/dynamic/qml/PerspectiveItem.qml | 25 | ||||
-rw-r--r-- | examples/declarative/toys/dynamic/qml/Sun.qml | 38 | ||||
-rw-r--r-- | examples/declarative/toys/dynamic/qml/itemCreation.js | 65 | ||||
-rw-r--r-- | examples/declarative/toys/tic-tac-toe/content/Button.qml (renamed from examples/declarative/tic-tac-toe/content/Button.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/tic-tac-toe/content/TicTac.qml (renamed from examples/declarative/tic-tac-toe/content/TicTac.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/tic-tac-toe/content/pics/board.png (renamed from examples/declarative/tic-tac-toe/content/pics/board.png) | bin | 12258 -> 12258 bytes | |||
-rw-r--r-- | examples/declarative/toys/tic-tac-toe/content/pics/o.png (renamed from examples/declarative/tic-tac-toe/content/pics/o.png) | bin | 1470 -> 1470 bytes | |||
-rw-r--r-- | examples/declarative/toys/tic-tac-toe/content/pics/x.png (renamed from examples/declarative/tic-tac-toe/content/pics/x.png) | bin | 1331 -> 1331 bytes | |||
-rw-r--r-- | examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js (renamed from examples/declarative/tic-tac-toe/content/tic-tac-toe.js) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml (renamed from examples/declarative/tic-tac-toe/tic-tac-toe.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject (renamed from examples/declarative/connections/connections.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/toys.qmlproject (renamed from examples/declarative/border-image/border-image.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/tvtennis/tvtennis.qml (renamed from examples/declarative/tvtennis/tvtennis.qml) | 8 | ||||
-rw-r--r-- | examples/declarative/toys/tvtennis/tvtennis.qmlproject (renamed from examples/declarative/aspectratio/aspectratio.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/velocity/Day.qml (renamed from examples/declarative/velocity/Day.qml) | 2 | ||||
-rw-r--r-- | examples/declarative/toys/velocity/cork.jpg (renamed from examples/declarative/velocity/cork.jpg) | bin | 149337 -> 149337 bytes | |||
-rw-r--r-- | examples/declarative/toys/velocity/note-yellow.png (renamed from examples/declarative/velocity/note-yellow.png) | bin | 54559 -> 54559 bytes | |||
-rw-r--r-- | examples/declarative/toys/velocity/tack.png (renamed from examples/declarative/velocity/tack.png) | bin | 7282 -> 7282 bytes | |||
-rw-r--r-- | examples/declarative/toys/velocity/velocity.qml (renamed from examples/declarative/velocity/velocity.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/toys/velocity/velocity.qmlproject (renamed from examples/declarative/animations/animations.qmlproject) | 0 | ||||
-rw-r--r-- | examples/declarative/tutorials/extending/extending.pro | 9 | ||||
-rw-r--r-- | examples/declarative/tutorials/helloworld/tutorial1.qml | 3 | ||||
-rw-r--r-- | examples/declarative/tutorials/helloworld/tutorial2.qml | 3 | ||||
-rw-r--r-- | examples/declarative/tutorials/helloworld/tutorial3.qml | 5 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame1/Block.qml | 2 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame1/Button.qml | 17 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame1/samegame.qml | 7 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame2/Block.qml | 2 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame2/Button.qml | 17 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame2/samegame.js | 11 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame2/samegame.qml | 5 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame3/Button.qml | 17 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame3/Dialog.qml | 33 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame3/samegame.js | 20 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame3/samegame.qml | 14 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame4/content/Button.qml | 17 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml | 57 | ||||
-rwxr-xr-x | examples/declarative/tutorials/samegame/samegame4/content/samegame.js | 28 | ||||
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame4/samegame.qml | 38 | ||||
-rw-r--r-- | examples/declarative/tutorials/tutorials.pro | 5 | ||||
-rw-r--r-- | examples/declarative/tvtennis/click.wav | bin | 3056 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/tvtennis/paddle.wav | bin | 5320 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/flipable/content/5_heart.png (renamed from examples/declarative/flipable/content/5_heart.png) | bin | 3872 -> 3872 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/flipable/content/9_club.png (renamed from examples/declarative/flipable/content/9_club.png) | bin | 6135 -> 6135 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/flipable/content/Card.qml (renamed from examples/declarative/flipable/content/Card.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/flipable/content/back.png (renamed from examples/declarative/flipable/content/back.png) | bin | 1418 -> 1418 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/flipable/flipable-example.qml (renamed from examples/declarative/flipable/flipable-example.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/flipable/flipable.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/progressbar/content/ProgressBar.qml (renamed from examples/declarative/progressbar/content/ProgressBar.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/progressbar/content/background.png (renamed from examples/declarative/progressbar/content/background.png) | bin | 426 -> 426 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/progressbar/progressbar.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/progressbar/progressbars.qml (renamed from examples/declarative/progressbar/progressbars.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/scrollbar/ScrollBar.qml | 33 | ||||
-rw-r--r-- | examples/declarative/ui-components/scrollbar/display.qml (renamed from examples/declarative/scrollbar/display.qml) | 6 | ||||
-rw-r--r-- | examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg (renamed from examples/declarative/scrollbar/pics/niagara_falls.jpg) | bin | 604121 -> 604121 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/scrollbar/scrollbar.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/searchbox/SearchBox.qml (renamed from examples/declarative/searchbox/SearchBox.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/searchbox/images/edit-clear-locationbar-rtl.png (renamed from examples/declarative/searchbox/images/edit-clear-locationbar-rtl.png) | bin | 429 -> 429 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png (renamed from examples/declarative/searchbox/images/lineedit-bg-focus.png) | bin | 526 -> 526 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/searchbox/images/lineedit-bg.png (renamed from examples/declarative/searchbox/images/lineedit-bg.png) | bin | 426 -> 426 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/searchbox/main.qml (renamed from examples/declarative/searchbox/main.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/searchbox/searchbox.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/slideswitch/content/Switch.qml (renamed from examples/declarative/slideswitch/content/Switch.qml) | 4 | ||||
-rw-r--r-- | examples/declarative/ui-components/slideswitch/content/background.svg (renamed from examples/declarative/slideswitch/content/background.svg) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/slideswitch/content/knob.svg (renamed from examples/declarative/slideswitch/content/knob.svg) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/slideswitch/slideswitch.qml (renamed from examples/declarative/slideswitch/slideswitch.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/slideswitch/slideswitch.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/spinner/content/Spinner.qml | 25 | ||||
-rw-r--r-- | examples/declarative/ui-components/spinner/content/spinner-bg.png | bin | 0 -> 345 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/spinner/content/spinner-select.png | bin | 0 -> 320 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/spinner/main.qml | 18 | ||||
-rw-r--r-- | examples/declarative/ui-components/spinner/spinner.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/tabwidget/TabWidget.qml (renamed from examples/declarative/tabwidget/TabWidget.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/tabwidget/tab.png (renamed from examples/declarative/tabwidget/tab.png) | bin | 507 -> 507 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/tabwidget/tabs.qml (renamed from examples/declarative/tabwidget/tabs.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/tabwidget/tabwidget.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/ui-components.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/xml/xml.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/xml/xmlhttprequest/test.qml (renamed from examples/declarative/xmlhttprequest/test.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/xml/xmlhttprequest/test.xml (renamed from examples/declarative/xmlhttprequest/test.xml) | 0 | ||||
-rw-r--r-- | examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/xmldata/daringfireball.qml | 48 | ||||
-rw-r--r-- | examples/declarative/xmldata/yahoonews.qml | 83 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/flippablepad.cpp | 99 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/flippablepad.h | 64 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/form.ui (renamed from examples/graphicsview/padnavigator/backside.ui) | 4 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/main.cpp | 14 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/padnavigator.cpp | 307 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/padnavigator.h | 71 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/padnavigator.pro | 23 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/panel.cpp | 238 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/panel.h | 92 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/roundrectitem.cpp | 146 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/roundrectitem.h | 51 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/splashitem.cpp | 48 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/splashitem.h | 25 | ||||
-rw-r--r-- | examples/network/bearermonitor/bearermonitor.cpp | 3 | ||||
-rw-r--r-- | examples/network/bearermonitor/sessionwidget.cpp | 12 | ||||
-rw-r--r-- | examples/network/bearermonitor/sessionwidget.h | 5 | ||||
-rw-r--r-- | examples/network/bearermonitor/sessionwidget.ui | 2 |
437 files changed, 3097 insertions, 1693 deletions
diff --git a/examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject b/examples/declarative/animation/animation.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject +++ b/examples/declarative/animation/animation.qmlproject diff --git a/examples/declarative/xmldata/xmldata.qmlproject b/examples/declarative/animation/basics/basics.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/xmldata/xmldata.qmlproject +++ b/examples/declarative/animation/basics/basics.qmlproject diff --git a/examples/declarative/animations/color-animation.qml b/examples/declarative/animation/basics/color-animation.qml index 3616a31..61737e9 100644 --- a/examples/declarative/animations/color-animation.qml +++ b/examples/declarative/animation/basics/color-animation.qml @@ -31,15 +31,14 @@ Item { // the sun, moon, and stars Item { width: parent.width; height: 2 * parent.height - transformOrigin: Item.Center NumberAnimation on rotation { from: 0; to: 360; duration: 10000; loops: Animation.Infinite } Image { source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Center; rotation: -3 * parent.rotation + rotation: -3 * parent.rotation } Image { source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Center; rotation: -parent.rotation + rotation: -parent.rotation } Particles { x: 0; y: parent.height/2; width: parent.width; height: parent.height/2 diff --git a/examples/declarative/parallax/pics/face-smile.png b/examples/declarative/animation/basics/images/face-smile.png Binary files differindex 3d66d72..3d66d72 100644 --- a/examples/declarative/parallax/pics/face-smile.png +++ b/examples/declarative/animation/basics/images/face-smile.png diff --git a/examples/declarative/animations/images/moon.png b/examples/declarative/animation/basics/images/moon.png Binary files differindex 9407b2b..9407b2b 100644 --- a/examples/declarative/animations/images/moon.png +++ b/examples/declarative/animation/basics/images/moon.png diff --git a/examples/declarative/parallax/pics/shadow.png b/examples/declarative/animation/basics/images/shadow.png Binary files differindex 8270565..8270565 100644 --- a/examples/declarative/parallax/pics/shadow.png +++ b/examples/declarative/animation/basics/images/shadow.png diff --git a/examples/declarative/dynamic/images/star.png b/examples/declarative/animation/basics/images/star.png Binary files differindex 27ef924..27ef924 100644 --- a/examples/declarative/dynamic/images/star.png +++ b/examples/declarative/animation/basics/images/star.png diff --git a/examples/declarative/dynamic/images/sun.png b/examples/declarative/animation/basics/images/sun.png Binary files differindex 7713ca5..7713ca5 100644 --- a/examples/declarative/dynamic/images/sun.png +++ b/examples/declarative/animation/basics/images/sun.png diff --git a/examples/declarative/animations/property-animation.qml b/examples/declarative/animation/basics/property-animation.qml index 5afe8ef..87ac8ec 100644 --- a/examples/declarative/animations/property-animation.qml +++ b/examples/declarative/animation/basics/property-animation.qml @@ -26,7 +26,6 @@ Item { Image { anchors.horizontalCenter: parent.horizontalCenter source: "images/shadow.png"; y: smiley.minHeight + 58 - transformOrigin: Item.Center // The scale property depends on the y position of the smiley face. scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) @@ -48,13 +47,13 @@ Item { // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function NumberAnimation { from: smiley.minHeight; to: smiley.maxHeight - easing.type: "OutExpo"; duration: 300 + easing.type: Easing.OutExpo; duration: 300 } // Then move back to minHeight in 1 second, using the OutBounce easing function NumberAnimation { from: smiley.maxHeight; to: smiley.minHeight - easing.type: "OutBounce"; duration: 1000 + easing.type: Easing.OutBounce; duration: 1000 } // Then pause for 500ms diff --git a/examples/declarative/behaviors/SideRect.qml b/examples/declarative/animation/behaviors/SideRect.qml index d32bd7b..d32bd7b 100644 --- a/examples/declarative/behaviors/SideRect.qml +++ b/examples/declarative/animation/behaviors/SideRect.qml diff --git a/examples/declarative/behaviors/behavior-example.qml b/examples/declarative/animation/behaviors/behavior-example.qml index b7bae6c..1f17b81 100644 --- a/examples/declarative/behaviors/behavior-example.qml +++ b/examples/declarative/animation/behaviors/behavior-example.qml @@ -49,12 +49,12 @@ Rectangle { // Setting an 'elastic' behavior on the focusRect's x property. Behavior on x { - NumberAnimation { easing.type: "OutElastic"; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } + NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } } // Setting an 'elastic' behavior on the focusRect's y property. Behavior on y { - NumberAnimation { easing.type: "OutElastic"; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } + NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } } Text { diff --git a/examples/declarative/behaviors/behaviors.qmlproject b/examples/declarative/animation/behaviors/behaviors.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/behaviors/behaviors.qmlproject +++ b/examples/declarative/animation/behaviors/behaviors.qmlproject diff --git a/examples/declarative/animation/easing/easing.qml b/examples/declarative/animation/easing/easing.qml new file mode 100644 index 0000000..939d43b --- /dev/null +++ b/examples/declarative/animation/easing/easing.qml @@ -0,0 +1,105 @@ +import Qt 4.7 + +Rectangle { + id: window + width: 600; height: 460; color: "#232323" + + ListModel { + id: easingTypes + ListElement { name: "Easing.Linear"; type: Easing.Linear; ballColor: "DarkRed" } + ListElement { name: "Easing.InQuad"; type: Easing.InQuad; ballColor: "IndianRed" } + ListElement { name: "Easing.OutQuad"; type: Easing.OutQuad; ballColor: "Salmon" } + ListElement { name: "Easing.InOutQuad"; type: Easing.InOutQuad; ballColor: "Tomato" } + ListElement { name: "Easing.OutInQuad"; type: Easing.OutInQuad; ballColor: "DarkOrange" } + ListElement { name: "Easing.InCubic"; type: Easing.InCubic; ballColor: "Gold" } + ListElement { name: "Easing.OutCubic"; type: Easing.OutCubic; ballColor: "Yellow" } + ListElement { name: "Easing.InOutCubic"; type: Easing.InOutCubic; ballColor: "PeachPuff" } + ListElement { name: "Easing.OutInCubic"; type: Easing.OutInCubic; ballColor: "Thistle" } + ListElement { name: "Easing.InQuart"; type: Easing.InQuart; ballColor: "Orchid" } + ListElement { name: "Easing.OutQuart"; type: Easing.OutQuart; ballColor: "Purple" } + ListElement { name: "Easing.InOutQuart"; type: Easing.InOutQuart; ballColor: "SlateBlue" } + ListElement { name: "Easing.OutInQuart"; type: Easing.OutInQuart; ballColor: "Chartreuse" } + ListElement { name: "Easing.InQuint"; type: Easing.InQuint; ballColor: "LimeGreen" } + ListElement { name: "Easing.OutQuint"; type: Easing.OutQuint; ballColor: "SeaGreen" } + ListElement { name: "Easing.InOutQuint"; type: Easing.InOutQuint; ballColor: "DarkGreen" } + ListElement { name: "Easing.OutInQuint"; type: Easing.OutInQuint; ballColor: "Olive" } + ListElement { name: "Easing.InSine"; type: Easing.InSine; ballColor: "DarkSeaGreen" } + ListElement { name: "Easing.OutSine"; type: Easing.OutSine; ballColor: "Teal" } + ListElement { name: "Easing.InOutSine"; type: Easing.InOutSine; ballColor: "Turquoise" } + ListElement { name: "Easing.OutInSine"; type: Easing.OutInSine; ballColor: "SteelBlue" } + ListElement { name: "Easing.InExpo"; type: Easing.InExpo; ballColor: "SkyBlue" } + ListElement { name: "Easing.OutExpo"; type: Easing.OutExpo; ballColor: "RoyalBlue" } + ListElement { name: "Easing.InOutExpo"; type: Easing.InOutExpo; ballColor: "MediumBlue" } + ListElement { name: "Easing.OutInExpo"; type: Easing.OutInExpo; ballColor: "MidnightBlue" } + ListElement { name: "Easing.InCirc"; type: Easing.InCirc; ballColor: "CornSilk" } + ListElement { name: "Easing.OutCirc"; type: Easing.OutCirc; ballColor: "Bisque" } + ListElement { name: "Easing.InOutCirc"; type: Easing.InOutCirc; ballColor: "RosyBrown" } + ListElement { name: "Easing.OutInCirc"; type: Easing.OutInCirc; ballColor: "SandyBrown" } + ListElement { name: "Easing.InElastic"; type: Easing.InElastic; ballColor: "DarkGoldenRod" } + ListElement { name: "Easing.InElastic"; type: Easing.OutElastic; ballColor: "Chocolate" } + ListElement { name: "Easing.InOutElastic"; type: Easing.InOutElastic; ballColor: "SaddleBrown" } + ListElement { name: "Easing.OutInElastic"; type: Easing.OutInElastic; ballColor: "Brown" } + ListElement { name: "Easing.InBack"; type: Easing.InBack; ballColor: "Maroon" } + ListElement { name: "Easing.OutBack"; type: Easing.OutBack; ballColor: "LavenderBlush" } + ListElement { name: "Easing.InOutBack"; type: Easing.InOutBack; ballColor: "MistyRose" } + ListElement { name: "Easing.OutInBack"; type: Easing.OutInBack; ballColor: "Gainsboro" } + ListElement { name: "Easing.OutBounce"; type: Easing.OutBounce; ballColor: "Silver" } + ListElement { name: "Easing.InBounce"; type: Easing.InBounce; ballColor: "DimGray" } + ListElement { name: "Easing.InOutBounce"; type: Easing.InOutBounce; ballColor: "SlateGray" } + ListElement { name: "Easing.OutInBounce"; type: Easing.OutInBounce; ballColor: "DarkSlateGray" } + } + + Component { + id: delegate + + Item { + height: 42; width: window.width + + Text { text: name; anchors.centerIn: parent; color: "White" } + + Rectangle { + id: slot1; color: "#121212"; x: 30; height: 32; width: 32 + border.color: "#343434"; border.width: 1; radius: 8 + anchors.verticalCenter: parent.verticalCenter + } + + Rectangle { + id: slot2; color: "#121212"; x: window.width - 62; height: 32; width: 32 + border.color: "#343434"; border.width: 1; radius: 8 + anchors.verticalCenter: parent.verticalCenter + } + + Rectangle { + id: rect; x: 30; color: "#454545" + border.color: "White"; border.width: 2 + height: 32; width: 32; radius: 8 + anchors.verticalCenter: parent.verticalCenter + + MouseArea { + onClicked: if (rect.state == '') rect.state = "right"; else rect.state = '' + anchors.fill: parent + } + + states : State { + name: "right" + PropertyChanges { target: rect; x: window.width - 62; color: ballColor } + } + + transitions: Transition { + NumberAnimation { properties: "x"; easing.type: type; duration: 1000 } + ColorAnimation { properties: "color"; easing.type: type; duration: 1000 } + } + } + } + } + + Flickable { + anchors.fill: parent; contentHeight: layout.height + + Column { + id: layout + anchors.left: parent.left; anchors.right: parent.right + Repeater { model: easingTypes; delegate: delegate } + } + } +} diff --git a/examples/declarative/workerscript/workerscript.qmlproject b/examples/declarative/animation/easing/easing.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/workerscript/workerscript.qmlproject +++ b/examples/declarative/animation/easing/easing.qmlproject diff --git a/examples/declarative/states/states.qml b/examples/declarative/animation/states/states.qml index 4429e78..4429e78 100644 --- a/examples/declarative/states/states.qml +++ b/examples/declarative/animation/states/states.qml diff --git a/examples/declarative/states/states.qmlproject b/examples/declarative/animation/states/states.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/states/states.qmlproject +++ b/examples/declarative/animation/states/states.qmlproject diff --git a/examples/declarative/states/transitions.qml b/examples/declarative/animation/states/transitions.qml index d1b1dd6..ccc7060 100644 --- a/examples/declarative/states/transitions.qml +++ b/examples/declarative/animation/states/transitions.qml @@ -72,14 +72,14 @@ Rectangle { // with OutBounce easing function. Transition { from: "*"; to: "middleRight" - NumberAnimation { properties: "x,y"; easing.type: "OutBounce"; duration: 1000 } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce; duration: 1000 } }, // When transitioning to 'bottomLeft' move x,y over a duration of 2 seconds, // with InOutQuad easing function. Transition { from: "*"; to: "bottomLeft" - NumberAnimation { properties: "x,y"; easing.type: "InOutQuad"; duration: 2000 } + NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: 2000 } }, // For any other state changes move x,y linearly over duration of 200ms. diff --git a/examples/declarative/states/user.png b/examples/declarative/animation/states/user.png Binary files differindex dd7d7a2..dd7d7a2 100644 --- a/examples/declarative/states/user.png +++ b/examples/declarative/animation/states/user.png diff --git a/examples/declarative/animations/easing.qml b/examples/declarative/animations/easing.qml deleted file mode 100644 index b0f9669..0000000 --- a/examples/declarative/animations/easing.qml +++ /dev/null @@ -1,99 +0,0 @@ -import Qt 4.7 - -Rectangle { - id: window - width: 600; height: 460; color: "#232323" - - ListModel { - id: easingTypes - ListElement { type: "Linear"; ballColor: "DarkRed" } - ListElement { type: "InQuad"; ballColor: "IndianRed" } - ListElement { type: "OutQuad"; ballColor: "Salmon" } - ListElement { type: "InOutQuad"; ballColor: "Tomato" } - ListElement { type: "OutInQuad"; ballColor: "DarkOrange" } - ListElement { type: "InCubic"; ballColor: "Gold" } - ListElement { type: "OutCubic"; ballColor: "Yellow" } - ListElement { type: "InOutCubic"; ballColor: "PeachPuff" } - ListElement { type: "OutInCubic"; ballColor: "Thistle" } - ListElement { type: "InQuart"; ballColor: "Orchid" } - ListElement { type: "OutQuart"; ballColor: "Purple" } - ListElement { type: "InOutQuart"; ballColor: "SlateBlue" } - ListElement { type: "OutInQuart"; ballColor: "Chartreuse" } - ListElement { type: "InQuint"; ballColor: "LimeGreen" } - ListElement { type: "OutQuint"; ballColor: "SeaGreen" } - ListElement { type: "InOutQuint"; ballColor: "DarkGreen" } - ListElement { type: "OutInQuint"; ballColor: "Olive" } - ListElement { type: "InSine"; ballColor: "DarkSeaGreen" } - ListElement { type: "OutSine"; ballColor: "Teal" } - ListElement { type: "InOutSine"; ballColor: "Turquoise" } - ListElement { type: "OutInSine"; ballColor: "SteelBlue" } - ListElement { type: "InExpo"; ballColor: "SkyBlue" } - ListElement { type: "OutExpo"; ballColor: "RoyalBlue" } - ListElement { type: "InOutExpo"; ballColor: "MediumBlue" } - ListElement { type: "OutInExpo"; ballColor: "MidnightBlue" } - ListElement { type: "InCirc"; ballColor: "CornSilk" } - ListElement { type: "OutCirc"; ballColor: "Bisque" } - ListElement { type: "InOutCirc"; ballColor: "RosyBrown" } - ListElement { type: "OutInCirc"; ballColor: "SandyBrown" } - ListElement { type: "InElastic"; ballColor: "DarkGoldenRod" } - ListElement { type: "OutElastic"; ballColor: "Chocolate" } - ListElement { type: "InOutElastic"; ballColor: "SaddleBrown" } - ListElement { type: "OutInElastic"; ballColor: "Brown" } - ListElement { type: "InBack"; ballColor: "Maroon" } - ListElement { type: "OutBack"; ballColor: "LavenderBlush" } - ListElement { type: "InOutBack"; ballColor: "MistyRose" } - ListElement { type: "OutInBack"; ballColor: "Gainsboro" } - ListElement { type: "OutBounce"; ballColor: "Silver" } - ListElement { type: "InBounce"; ballColor: "DimGray" } - ListElement { type: "InOutBounce"; ballColor: "SlateGray" } - ListElement { type: "OutInBounce"; ballColor: "DarkSlateGray" } - } - - Component { - id: delegate - - Item { - height: 42; width: window.width - Text { text: type; anchors.centerIn: parent; color: "White" } - Rectangle { - id: slot1; color: "#121212"; x: 30; height: 32; width: 32 - border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter - } - Rectangle { - id: slot2; color: "#121212"; x: window.width - 62; height: 32; width: 32 - border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter - } - Rectangle { - id: rect; x: 30; color: "#454545" - border.color: "White"; border.width: 2 - height: 32; width: 32; radius: 8; anchors.verticalCenter: parent.verticalCenter - - MouseArea { - onClicked: if (rect.state == '') rect.state = "right"; else rect.state = '' - anchors.fill: parent - } - - states : State { - name: "right" - PropertyChanges { target: rect; x: window.width - 62; color: ballColor } - } - - transitions: Transition { - // ParallelAnimation { - NumberAnimation { properties: "x"; easing.type: type; duration: 1000 } - ColorAnimation { properties: "color"; easing.type: type; duration: 1000 } - // } - } - } - } - } - - Flickable { - anchors.fill: parent; contentHeight: layout.height - Column { - id: layout - anchors.left: parent.left; anchors.right: parent.right - Repeater { model: easingTypes; delegate: delegate } - } - } -} diff --git a/examples/declarative/border-image/animated.qml b/examples/declarative/border-image/animated.qml deleted file mode 100644 index c3ff9ef..0000000 --- a/examples/declarative/border-image/animated.qml +++ /dev/null @@ -1,54 +0,0 @@ -import Qt 4.7 -import "content" - -Rectangle { - id: page - width: 1030; height: 540 - - MyBorderImage { - x: 20; y: 20; minWidth: 120; maxWidth: 240 - minHeight: 120; maxHeight: 240 - source: "content/colors.png"; margin: 30 - } - MyBorderImage { - x: 270; y: 20; minWidth: 120; maxWidth: 240 - minHeight: 120; maxHeight: 240 - source: "content/colors.png"; margin: 30 - horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat - } - MyBorderImage { - x: 520; y: 20; minWidth: 120; maxWidth: 240 - minHeight: 120; maxHeight: 240 - source: "content/colors.png"; margin: 30 - horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat - } - MyBorderImage { - x: 770; y: 20; minWidth: 120; maxWidth: 240 - minHeight: 120; maxHeight: 240 - source: "content/colors.png"; margin: 30 - horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round - } - MyBorderImage { - x: 20; y: 280; minWidth: 60; maxWidth: 200 - minHeight: 40; maxHeight: 200 - source: "content/bw.png"; margin: 10 - } - MyBorderImage { - x: 270; y: 280; minWidth: 60; maxWidth: 200 - minHeight: 40; maxHeight: 200 - source: "content/bw.png"; margin: 10 - horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat - } - MyBorderImage { - x: 520; y: 280; minWidth: 60; maxWidth: 200 - minHeight: 40; maxHeight: 200 - source: "content/bw.png"; margin: 10 - horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat - } - MyBorderImage { - x: 770; y: 280; minWidth: 60; maxWidth: 200 - minHeight: 40; maxHeight: 200 - source: "content/bw.png"; margin: 10 - horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round - } -} diff --git a/examples/declarative/border-image/borders.qml b/examples/declarative/border-image/borders.qml deleted file mode 100644 index 3743f7e..0000000 --- a/examples/declarative/border-image/borders.qml +++ /dev/null @@ -1,17 +0,0 @@ -import Qt 4.7 - -Rectangle { - id: page - width: 520; height: 280 - - BorderImage { - x: 20; y: 20; width: 230; height: 240 - smooth: true - source: "content/colors-stretch.sci" - } - BorderImage { - x: 270; y: 20; width: 230; height: 240 - smooth: true - source: "content/colors-round.sci" - } -} diff --git a/examples/declarative/border-image/content/MyBorderImage.qml b/examples/declarative/border-image/content/MyBorderImage.qml deleted file mode 100644 index f65f093..0000000 --- a/examples/declarative/border-image/content/MyBorderImage.qml +++ /dev/null @@ -1,37 +0,0 @@ -import Qt 4.7 - -Item { - property alias horizontalMode: image.horizontalTileMode - property alias verticalMode: image.verticalTileMode - property alias source: image.source - - property int minWidth - property int minHeight - property int maxWidth - property int maxHeight - property int margin - - id: container - width: 240; height: 240 - - BorderImage { - id: image; x: container.width / 2 - width / 2; y: container.height / 2 - height / 2 - - SequentialAnimation on width { - loops: Animation.Infinite - NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 2000; easing.type: "InOutQuad"} - NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 2000; easing.type: "InOutQuad" } - } - - SequentialAnimation on height { - loops: Animation.Infinite - NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 2000; easing.type: "InOutQuad"} - NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 2000; easing.type: "InOutQuad" } - } - - border.top: container.margin - border.left: container.margin - border.bottom: container.margin - border.right: container.margin - } -} diff --git a/examples/declarative/connections/connections-example.qml b/examples/declarative/connections/connections-example.qml deleted file mode 100644 index fbef968..0000000 --- a/examples/declarative/connections/connections-example.qml +++ /dev/null @@ -1,38 +0,0 @@ -import Qt 4.7 -import "content" - -Rectangle { - id: window - - property int angle: 0 - - width: 640; height: 480 - color: "#646464" - - Image { - id: image - source: "content/bg1.jpg" - anchors.centerIn: parent - transformOrigin: Item.Center - rotation: window.angle - - Behavior on rotation { - NumberAnimation { easing.type: "OutCubic"; duration: 300 } - } - } - - Button { - id: leftButton - image: "content/rotate-left.png" - anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 10 } - } - - Button { - id: rightButton - image: "content/rotate-right.png" - anchors { right: parent.right; bottom: parent.bottom; rightMargin: 10; bottomMargin: 10 } - } - - Connections { target: leftButton; onClicked: window.angle -= 90 } - Connections { target: rightButton; onClicked: window.angle += 90 } -} diff --git a/examples/declarative/connections/content/Button.qml b/examples/declarative/connections/content/Button.qml deleted file mode 100644 index f95afbb..0000000 --- a/examples/declarative/connections/content/Button.qml +++ /dev/null @@ -1,12 +0,0 @@ -import Qt 4.7 - -Item { - id: button - width: 48; height: 48 - - property alias image: icon.source - signal clicked - - Image { id: icon } - MouseArea { anchors.fill: icon; onClicked: button.clicked() } -} diff --git a/examples/declarative/connections/content/bg1.jpg b/examples/declarative/connections/content/bg1.jpg Binary files differdeleted file mode 100644 index dfc7cee..0000000 --- a/examples/declarative/connections/content/bg1.jpg +++ /dev/null diff --git a/examples/declarative/connections/content/rotate-left.png b/examples/declarative/connections/content/rotate-left.png Binary files differdeleted file mode 100644 index c30387e..0000000 --- a/examples/declarative/connections/content/rotate-left.png +++ /dev/null diff --git a/examples/declarative/connections/content/rotate-right.png b/examples/declarative/connections/content/rotate-right.png Binary files differdeleted file mode 100644 index 1b05674..0000000 --- a/examples/declarative/connections/content/rotate-right.png +++ /dev/null diff --git a/examples/declarative/cppextensions/cppextensions.pro b/examples/declarative/cppextensions/cppextensions.pro new file mode 100644 index 0000000..caa6092 --- /dev/null +++ b/examples/declarative/cppextensions/cppextensions.pro @@ -0,0 +1,10 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + imageprovider \ + plugins \ + proxyviewer \ + proxywidgets \ + qgraphicslayouts \ + referenceexamples + diff --git a/examples/declarative/webview/webview.qmlproject b/examples/declarative/cppextensions/cppextensions.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/webview/webview.qmlproject +++ b/examples/declarative/cppextensions/cppextensions.qmlproject diff --git a/examples/declarative/imageprovider/ImageProviderCore/qmldir b/examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir index 1028590..1028590 100644 --- a/examples/declarative/imageprovider/ImageProviderCore/qmldir +++ b/examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir diff --git a/examples/declarative/imageprovider/imageprovider-example.qml b/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml index d774112..d774112 100644 --- a/examples/declarative/imageprovider/imageprovider-example.qml +++ b/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml diff --git a/examples/declarative/imageprovider/imageprovider.cpp b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp index 4c4aa94..4c4aa94 100644 --- a/examples/declarative/imageprovider/imageprovider.cpp +++ b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp diff --git a/examples/declarative/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro index 945a301..945a301 100644 --- a/examples/declarative/imageprovider/imageprovider.pro +++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro diff --git a/examples/declarative/imageprovider/imageprovider.qmlproject b/examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/imageprovider/imageprovider.qmlproject +++ b/examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject diff --git a/examples/declarative/plugins/README b/examples/declarative/cppextensions/plugins/README index fe519f8..fe519f8 100644 --- a/examples/declarative/plugins/README +++ b/examples/declarative/cppextensions/plugins/README diff --git a/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml index 0048372..0048372 100644 --- a/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml +++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml diff --git a/examples/declarative/plugins/com/nokia/TimeExample/center.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png Binary files differindex 7fbd802..7fbd802 100644 --- a/examples/declarative/plugins/com/nokia/TimeExample/center.png +++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png diff --git a/examples/declarative/plugins/com/nokia/TimeExample/clock.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png Binary files differindex 462edac..462edac 100644 --- a/examples/declarative/plugins/com/nokia/TimeExample/clock.png +++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png diff --git a/examples/declarative/plugins/com/nokia/TimeExample/hour.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png Binary files differindex f8061a1..f8061a1 100644 --- a/examples/declarative/plugins/com/nokia/TimeExample/hour.png +++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png diff --git a/examples/declarative/plugins/com/nokia/TimeExample/minute.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png Binary files differindex 1297ec7..1297ec7 100644 --- a/examples/declarative/plugins/com/nokia/TimeExample/minute.png +++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png diff --git a/examples/declarative/plugins/com/nokia/TimeExample/qmldir b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir index e9ef115..e9ef115 100644 --- a/examples/declarative/plugins/com/nokia/TimeExample/qmldir +++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir diff --git a/examples/declarative/plugins/plugin.cpp b/examples/declarative/cppextensions/plugins/plugin.cpp index fb51b0c..fb51b0c 100644 --- a/examples/declarative/plugins/plugin.cpp +++ b/examples/declarative/cppextensions/plugins/plugin.cpp diff --git a/examples/declarative/plugins/plugins.pro b/examples/declarative/cppextensions/plugins/plugins.pro index b501ae3..b501ae3 100644 --- a/examples/declarative/plugins/plugins.pro +++ b/examples/declarative/cppextensions/plugins/plugins.pro diff --git a/examples/declarative/plugins/plugins.qml b/examples/declarative/cppextensions/plugins/plugins.qml index 449cd9a..449cd9a 100644 --- a/examples/declarative/plugins/plugins.qml +++ b/examples/declarative/cppextensions/plugins/plugins.qml diff --git a/examples/declarative/plugins/plugins.qmlproject b/examples/declarative/cppextensions/plugins/plugins.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/plugins/plugins.qmlproject +++ b/examples/declarative/cppextensions/plugins/plugins.qmlproject diff --git a/examples/declarative/cppextensions/proxyviewer/main.cpp b/examples/declarative/cppextensions/proxyviewer/main.cpp new file mode 100644 index 0000000..b82d2c9 --- /dev/null +++ b/examples/declarative/cppextensions/proxyviewer/main.cpp @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> +#include <QNetworkAccessManager> +#include <QNetworkProxy> + +#include <QDeclarativeEngine> +#include <QDeclarativeNetworkAccessManagerFactory> +#include <QDeclarativeView> + + +/* + This example illustrates using a QNetworkAccessManagerFactory to + create a QNetworkAccessManager with a proxy. + + Usage: + proxyviewer [-host <proxy> -port <port>] [file] +*/ + +static QString proxyHost; +static int proxyPort = 0; + +class MyNetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory +{ +public: + virtual QNetworkAccessManager *create(QObject *parent); +}; + +QNetworkAccessManager *MyNetworkAccessManagerFactory::create(QObject *parent) +{ + QNetworkAccessManager *nam = new QNetworkAccessManager(parent); + if (!proxyHost.isEmpty()) { + qDebug() << "Created QNetworkAccessManager using proxy" << (proxyHost + ":" + QString::number(proxyPort)); + QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, proxyHost, proxyPort); + nam->setProxy(proxy); + } + + return nam; +} + +int main(int argc, char ** argv) +{ + QUrl source("qrc:view.qml"); + + QApplication app(argc, argv); + + for (int i = 1; i < argc; ++i) { + QString arg(argv[i]); + if (arg == "-host" && i < argc-1) { + proxyHost = argv[++i]; + } else if (arg == "-port" && i < argc-1) { + arg = argv[++i]; + proxyPort = arg.toInt(); + } else if (arg[0] != '-') { + source = QUrl::fromLocalFile(arg); + } else { + qWarning() << "Usage: proxyviewer [-host <proxy> -port <port>] [file]"; + exit(1); + } + } + + QDeclarativeView view; + view.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory); + + view.setSource(source); + view.show(); + + return app.exec(); +} + diff --git a/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro b/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro new file mode 100644 index 0000000..b6bfa7f --- /dev/null +++ b/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro @@ -0,0 +1,9 @@ +TEMPLATE = app +TARGET = proxyviewer +DEPENDPATH += . +INCLUDEPATH += . +QT += declarative network + +# Input +SOURCES += main.cpp +RESOURCES += proxyviewer.qrc diff --git a/examples/declarative/stringlistmodel/stringlistmodel.qrc b/examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc index 17e9301..17e9301 100644 --- a/examples/declarative/stringlistmodel/stringlistmodel.qrc +++ b/examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc diff --git a/examples/declarative/cppextensions/proxyviewer/view.qml b/examples/declarative/cppextensions/proxyviewer/view.qml new file mode 100644 index 0000000..7f1bdef --- /dev/null +++ b/examples/declarative/cppextensions/proxyviewer/view.qml @@ -0,0 +1,7 @@ +import Qt 4.7 + +Image { + width: 100 + height: 100 + source: "http://qt.nokia.com/logo.png" +} diff --git a/examples/declarative/proxywidgets/ProxyWidgets/qmldir b/examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir index e55267c..e55267c 100644 --- a/examples/declarative/proxywidgets/ProxyWidgets/qmldir +++ b/examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir diff --git a/examples/declarative/proxywidgets/README b/examples/declarative/cppextensions/proxywidgets/README index f50fa22..f50fa22 100644 --- a/examples/declarative/proxywidgets/README +++ b/examples/declarative/cppextensions/proxywidgets/README diff --git a/examples/declarative/proxywidgets/proxywidgets.cpp b/examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp index 067eb2c..067eb2c 100644 --- a/examples/declarative/proxywidgets/proxywidgets.cpp +++ b/examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp diff --git a/examples/declarative/proxywidgets/proxywidgets.pro b/examples/declarative/cppextensions/proxywidgets/proxywidgets.pro index cb07d80..cb07d80 100644 --- a/examples/declarative/proxywidgets/proxywidgets.pro +++ b/examples/declarative/cppextensions/proxywidgets/proxywidgets.pro diff --git a/examples/declarative/proxywidgets/proxywidgets.qml b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qml index 46dcf99..88de37f 100644 --- a/examples/declarative/proxywidgets/proxywidgets.qml +++ b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qml @@ -63,7 +63,7 @@ Rectangle { transitions: Transition { ParallelAnimation { - NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: "OutQuad" } + NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: Easing.OutQuad } ColorAnimation { target: window; duration: 600 } } } diff --git a/examples/declarative/proxywidgets/proxywidgets.qmlproject b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/proxywidgets/proxywidgets.qmlproject +++ b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicsLayouts.pro b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicsLayouts.pro new file mode 100644 index 0000000..e5d91b2 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicsLayouts.pro @@ -0,0 +1,13 @@ +TEMPLATE = app +TARGET = graphicslayouts +QT += declarative + +SOURCES += \ + graphicslayouts.cpp \ + main.cpp + +HEADERS += \ + graphicslayouts_p.h + +RESOURCES += \ + graphicslayouts.qrc diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.cpp b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.cpp new file mode 100644 index 0000000..25cf994 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.cpp @@ -0,0 +1,366 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "graphicslayouts_p.h" + +#include <QtGui/qgraphicswidget.h> +#include <QtCore/qdebug.h> + +QT_BEGIN_NAMESPACE + +LinearLayoutAttached::LinearLayoutAttached(QObject *parent) +: QObject(parent), _stretch(1), _alignment(Qt::AlignCenter), _spacing(0) +{ +} + +void LinearLayoutAttached::setStretchFactor(int f) +{ + if (_stretch == f) + return; + + _stretch = f; + emit stretchChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), _stretch); +} + +void LinearLayoutAttached::setSpacing(int s) +{ + if (_spacing == s) + return; + + _spacing = s; + emit spacingChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), _spacing); +} + +void LinearLayoutAttached::setAlignment(Qt::Alignment a) +{ + if (_alignment == a) + return; + + _alignment = a; + emit alignmentChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), _alignment); +} + +QGraphicsLinearLayoutStretchItemObject::QGraphicsLinearLayoutStretchItemObject(QObject *parent) + : QObject(parent) +{ +} + +QSizeF QGraphicsLinearLayoutStretchItemObject::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const +{ +Q_UNUSED(which); +Q_UNUSED(constraint); +return QSizeF(); +} + + +QGraphicsLinearLayoutObject::QGraphicsLinearLayoutObject(QObject *parent) +: QObject(parent) +{ +} + +QGraphicsLinearLayoutObject::~QGraphicsLinearLayoutObject() +{ +} + +void QGraphicsLinearLayoutObject::insertLayoutItem(int index, QGraphicsLayoutItem *item) +{ +insertItem(index, item); + +//connect attached properties +if (LinearLayoutAttached *obj = attachedProperties.value(item)) { + setStretchFactor(item, obj->stretchFactor()); + setAlignment(item, obj->alignment()); + updateSpacing(item, obj->spacing()); + QObject::connect(obj, SIGNAL(stretchChanged(QGraphicsLayoutItem*,int)), + this, SLOT(updateStretch(QGraphicsLayoutItem*,int))); + QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)), + this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment))); + QObject::connect(obj, SIGNAL(spacingChanged(QGraphicsLayoutItem*,int)), + this, SLOT(updateSpacing(QGraphicsLayoutItem*,int))); + //### need to disconnect when widget is removed? +} +} + +//### is there a better way to do this? +void QGraphicsLinearLayoutObject::clearChildren() +{ +for (int i = 0; i < count(); ++i) + removeAt(i); +} + +qreal QGraphicsLinearLayoutObject::contentsMargin() const +{ + qreal a,b,c,d; + getContentsMargins(&a, &b, &c, &d); + if(a==b && a==c && a==d) + return a; + return -1; +} + +void QGraphicsLinearLayoutObject::setContentsMargin(qreal m) +{ + setContentsMargins(m,m,m,m); +} + +void QGraphicsLinearLayoutObject::updateStretch(QGraphicsLayoutItem *item, int stretch) +{ +QGraphicsLinearLayout::setStretchFactor(item, stretch); +} + +void QGraphicsLinearLayoutObject::updateSpacing(QGraphicsLayoutItem* item, int spacing) +{ + for(int i=0; i < count(); i++){ + if(itemAt(i) == item){ //I do not see the reverse function, which is why we must loop over all items + QGraphicsLinearLayout::setItemSpacing(i, spacing); + return; + } + } +} + +void QGraphicsLinearLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) +{ +QGraphicsLinearLayout::setAlignment(item, alignment); +} + +QHash<QGraphicsLayoutItem*, LinearLayoutAttached*> QGraphicsLinearLayoutObject::attachedProperties; +LinearLayoutAttached *QGraphicsLinearLayoutObject::qmlAttachedProperties(QObject *obj) +{ +// ### This is not allowed - you must attach to any object +if (!qobject_cast<QGraphicsLayoutItem*>(obj)) + return 0; +LinearLayoutAttached *rv = new LinearLayoutAttached(obj); +attachedProperties.insert(qobject_cast<QGraphicsLayoutItem*>(obj), rv); +return rv; +} + +////////////////////////////////////////////////////////////////////////////////////////////////////// +// QGraphicsGridLayout-related classes +////////////////////////////////////////////////////////////////////////////////////////////////////// +GridLayoutAttached::GridLayoutAttached(QObject *parent) +: QObject(parent), _row(-1), _column(-1), _rowspan(1), _colspan(1), _alignment(-1), _rowstretch(-1), + _colstretch(-1), _rowspacing(-1), _colspacing(-1), _rowprefheight(-1), _rowmaxheight(-1), _rowminheight(-1), + _rowfixheight(-1), _colprefwidth(-1), _colmaxwidth(-1), _colminwidth(-1), _colfixwidth(-1) +{ +} + +void GridLayoutAttached::setRow(int r) +{ + if (_row == r) + return; + + _row = r; + //emit rowChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), _row); +} + +void GridLayoutAttached::setColumn(int c) +{ + if (_column == c) + return; + + _column = c; + //emit columnChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), _column); +} + +void GridLayoutAttached::setRowSpan(int rs) +{ + if (_rowspan == rs) + return; + + _rowspan = rs; + //emit rowSpanChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), _rowSpan); +} + +void GridLayoutAttached::setColumnSpan(int cs) +{ + if (_colspan == cs) + return; + + _colspan = cs; + //emit columnSpanChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), _columnSpan); +} + +void GridLayoutAttached::setAlignment(Qt::Alignment a) +{ + if (_alignment == a) + return; + + _alignment = a; + emit alignmentChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), _alignment); +} + +void GridLayoutAttached::setRowStretchFactor(int f) +{ + _rowstretch = f; +} + +void GridLayoutAttached::setColumnStretchFactor(int f) +{ + _colstretch = f; +} + +void GridLayoutAttached::setRowSpacing(int s) +{ + _rowspacing = s; +} + +void GridLayoutAttached::setColumnSpacing(int s) +{ + _colspacing = s; +} + + +QGraphicsGridLayoutObject::QGraphicsGridLayoutObject(QObject *parent) +: QObject(parent) +{ +} + +QGraphicsGridLayoutObject::~QGraphicsGridLayoutObject() +{ +} + +void QGraphicsGridLayoutObject::addWidget(QGraphicsWidget *wid) +{ +//use attached properties +if (QObject *obj = attachedProperties.value(qobject_cast<QGraphicsLayoutItem*>(wid))) { + int row = static_cast<GridLayoutAttached *>(obj)->row(); + int column = static_cast<GridLayoutAttached *>(obj)->column(); + int rowSpan = static_cast<GridLayoutAttached *>(obj)->rowSpan(); + int columnSpan = static_cast<GridLayoutAttached *>(obj)->columnSpan(); + if (row == -1 || column == -1) { + qWarning() << "Must set row and column for an item in a grid layout"; + return; + } + addItem(wid, row, column, rowSpan, columnSpan); +} +} + +void QGraphicsGridLayoutObject::addLayoutItem(QGraphicsLayoutItem *item) +{ +//use attached properties +if (GridLayoutAttached *obj = attachedProperties.value(item)) { + int row = obj->row(); + int column = obj->column(); + int rowSpan = obj->rowSpan(); + int columnSpan = obj->columnSpan(); + Qt::Alignment alignment = obj->alignment(); + if (row == -1 || column == -1) { + qWarning() << "Must set row and column for an item in a grid layout"; + return; + } + if(obj->rowSpacing() != -1) + setRowSpacing(row, obj->rowSpacing()); + if(obj->columnSpacing() != -1) + setColumnSpacing(column, obj->columnSpacing()); + if(obj->rowStretchFactor() != -1) + setRowStretchFactor(row, obj->rowStretchFactor()); + if(obj->columnStretchFactor() != -1) + setColumnStretchFactor(column, obj->columnStretchFactor()); + if(obj->rowPreferredHeight() != -1) + setRowPreferredHeight(row, obj->rowPreferredHeight()); + if(obj->rowMaximumHeight() != -1) + setRowMaximumHeight(row, obj->rowMaximumHeight()); + if(obj->rowMinimumHeight() != -1) + setRowMinimumHeight(row, obj->rowMinimumHeight()); + if(obj->rowFixedHeight() != -1) + setRowFixedHeight(row, obj->rowFixedHeight()); + if(obj->columnPreferredWidth() != -1) + setColumnPreferredWidth(row, obj->columnPreferredWidth()); + if(obj->columnMaximumWidth() != -1) + setColumnMaximumWidth(row, obj->columnMaximumWidth()); + if(obj->columnMinimumWidth() != -1) + setColumnMinimumWidth(row, obj->columnMinimumWidth()); + if(obj->columnFixedWidth() != -1) + setColumnFixedWidth(row, obj->columnFixedWidth()); + addItem(item, row, column, rowSpan, columnSpan); + if (alignment != -1) + setAlignment(item,alignment); + QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)), + this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment))); + //### need to disconnect when widget is removed? +} +} + +//### is there a better way to do this? +void QGraphicsGridLayoutObject::clearChildren() +{ +for (int i = 0; i < count(); ++i) + removeAt(i); +} + +qreal QGraphicsGridLayoutObject::spacing() const +{ +if (verticalSpacing() == horizontalSpacing()) + return verticalSpacing(); +return -1; //### +} + +qreal QGraphicsGridLayoutObject::contentsMargin() const +{ + qreal a,b,c,d; + getContentsMargins(&a, &b, &c, &d); + if(a==b && a==c && a==d) + return a; + return -1; +} + +void QGraphicsGridLayoutObject::setContentsMargin(qreal m) +{ + setContentsMargins(m,m,m,m); +} + + +void QGraphicsGridLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) +{ +QGraphicsGridLayout::setAlignment(item, alignment); +} + +QHash<QGraphicsLayoutItem*, GridLayoutAttached*> QGraphicsGridLayoutObject::attachedProperties; +GridLayoutAttached *QGraphicsGridLayoutObject::qmlAttachedProperties(QObject *obj) +{ +// ### This is not allowed - you must attach to any object +if (!qobject_cast<QGraphicsLayoutItem*>(obj)) + return 0; +GridLayoutAttached *rv = new GridLayoutAttached(obj); +attachedProperties.insert(qobject_cast<QGraphicsLayoutItem*>(obj), rv); +return rv; +} + +QT_END_NAMESPACE diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml new file mode 100644 index 0000000..fcd78d5 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml @@ -0,0 +1,77 @@ +import Qt 4.7 +import GraphicsLayouts 4.7 + +Item { + id: resizable + + width: 800 + height: 400 + + QGraphicsWidget { + size.width: parent.width/2 + size.height: parent.height + + layout: QGraphicsLinearLayout { + LayoutItem { + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { color: "yellow"; anchors.fill: parent } + } + LayoutItem { + minimumSize: "100x100" + maximumSize: "400x400" + preferredSize: "200x200" + Rectangle { color: "green"; anchors.fill: parent } + } + } + } + QGraphicsWidget { + x: parent.width/2 + size.width: parent.width/2 + size.height: parent.height + + layout: QGraphicsGridLayout { + LayoutItem { + QGraphicsGridLayout.row: 0 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { color: "red"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 1 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "200x200" + preferredSize: "100x100" + Rectangle { color: "orange"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 2 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "200x200" + Rectangle { color: "yellow"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 0 + QGraphicsGridLayout.column: 1 + minimumSize: "100x100" + maximumSize: "200x200" + preferredSize: "200x200" + Rectangle { color: "green"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 1 + QGraphicsGridLayout.column: 1 + minimumSize: "100x100" + maximumSize: "400x400" + preferredSize: "200x200" + Rectangle { color: "blue"; anchors.fill: parent } + } + } + } +} diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qrc b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qrc new file mode 100644 index 0000000..a199f8d --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>graphicslayouts.qml</file> +</qresource> +</RCC> diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts_p.h b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts_p.h new file mode 100644 index 0000000..ea9c614 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts_p.h @@ -0,0 +1,303 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GRAPHICSLAYOUTS_H +#define GRAPHICSLAYOUTS_H + +#include <QtGui/QGraphicsLinearLayout> +#include <QtGui/QGraphicsGridLayout> +#include <qdeclarative.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QGraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayoutItem) +public: + QGraphicsLinearLayoutStretchItemObject(QObject *parent = 0); + + virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const; +}; + +class LinearLayoutAttached; +class QGraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) + + Q_PROPERTY(QDeclarativeListProperty<QGraphicsLayoutItem> children READ children) + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) + Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) + Q_CLASSINFO("DefaultProperty", "children") +public: + QGraphicsLinearLayoutObject(QObject * = 0); + ~QGraphicsLinearLayoutObject(); + + QDeclarativeListProperty<QGraphicsLayoutItem> children() { return QDeclarativeListProperty<QGraphicsLayoutItem>(this, 0, children_append, children_count, children_at, children_clear); } + + static LinearLayoutAttached *qmlAttachedProperties(QObject *); + + qreal contentsMargin() const; + void setContentsMargin(qreal); + +private Q_SLOTS: + void updateStretch(QGraphicsLayoutItem*,int); + void updateSpacing(QGraphicsLayoutItem*,int); + void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); + +private: + friend class LinearLayoutAttached; + void clearChildren(); + void insertLayoutItem(int, QGraphicsLayoutItem *); + static QHash<QGraphicsLayoutItem*, LinearLayoutAttached*> attachedProperties; + + static void children_append(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, QGraphicsLayoutItem *item) { + static_cast<QGraphicsLinearLayoutObject*>(prop->object)->insertLayoutItem(-1, item); + } + + static void children_clear(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) { + static_cast<QGraphicsLinearLayoutObject*>(prop->object)->clearChildren(); + } + + static int children_count(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) { + return static_cast<QGraphicsLinearLayoutObject*>(prop->object)->count(); + } + + static QGraphicsLayoutItem *children_at(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, int index) { + return static_cast<QGraphicsLinearLayoutObject*>(prop->object)->itemAt(index); + } +}; + +class GridLayoutAttached; +class QGraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) + + Q_PROPERTY(QDeclarativeListProperty<QGraphicsLayoutItem> children READ children) + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) + Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) + Q_PROPERTY(qreal verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) + Q_PROPERTY(qreal horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing) + Q_CLASSINFO("DefaultProperty", "children") +public: + QGraphicsGridLayoutObject(QObject * = 0); + ~QGraphicsGridLayoutObject(); + + QDeclarativeListProperty<QGraphicsLayoutItem> children() { return QDeclarativeListProperty<QGraphicsLayoutItem>(this, 0, children_append, children_count, children_at, children_clear); } + + qreal spacing() const; + qreal contentsMargin() const; + void setContentsMargin(qreal); + + static GridLayoutAttached *qmlAttachedProperties(QObject *); + +private Q_SLOTS: + void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); + +private: + friend class GraphicsLayoutAttached; + void addWidget(QGraphicsWidget *); + void clearChildren(); + void addLayoutItem(QGraphicsLayoutItem *); + static QHash<QGraphicsLayoutItem*, GridLayoutAttached*> attachedProperties; + + static void children_append(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, QGraphicsLayoutItem *item) { + static_cast<QGraphicsGridLayoutObject*>(prop->object)->addLayoutItem(item); + } + + static void children_clear(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) { + static_cast<QGraphicsGridLayoutObject*>(prop->object)->clearChildren(); + } + + static int children_count(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) { + return static_cast<QGraphicsGridLayoutObject*>(prop->object)->count(); + } + + static QGraphicsLayoutItem *children_at(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, int index) { + return static_cast<QGraphicsGridLayoutObject*>(prop->object)->itemAt(index); + } +}; + +class LinearLayoutAttached : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int stretchFactor READ stretchFactor WRITE setStretchFactor NOTIFY stretchChanged) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) + Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) +public: + LinearLayoutAttached(QObject *parent); + + int stretchFactor() const { return _stretch; } + void setStretchFactor(int f); + Qt::Alignment alignment() const { return _alignment; } + void setAlignment(Qt::Alignment a); + int spacing() const { return _spacing; } + void setSpacing(int s); + +Q_SIGNALS: + void stretchChanged(QGraphicsLayoutItem*,int); + void alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment); + void spacingChanged(QGraphicsLayoutItem*,int); + +private: + int _stretch; + Qt::Alignment _alignment; + int _spacing; +}; + +class GridLayoutAttached : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int row READ row WRITE setRow) + Q_PROPERTY(int column READ column WRITE setColumn) + Q_PROPERTY(int rowSpan READ rowSpan WRITE setRowSpan) + Q_PROPERTY(int columnSpan READ columnSpan WRITE setColumnSpan) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) + Q_PROPERTY(int rowStretchFactor READ rowStretchFactor WRITE setRowStretchFactor) + Q_PROPERTY(int columnStretchFactor READ columnStretchFactor WRITE setColumnStretchFactor) + Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing) + Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing) + Q_PROPERTY(int rowPreferredHeight READ rowPreferredHeight WRITE setRowPreferredHeight) + Q_PROPERTY(int rowMinimumHeight READ rowMinimumHeight WRITE setRowMinimumHeight) + Q_PROPERTY(int rowMaximumHeight READ rowMaximumHeight WRITE setRowMaximumHeight) + Q_PROPERTY(int rowFixedHeight READ rowFixedHeight WRITE setRowFixedHeight) + Q_PROPERTY(int columnPreferredWidth READ columnPreferredWidth WRITE setColumnPreferredWidth) + Q_PROPERTY(int columnMaximumWidth READ columnMaximumWidth WRITE setColumnMaximumWidth) + Q_PROPERTY(int columnMinimumWidth READ columnMinimumWidth WRITE setColumnMinimumWidth) + Q_PROPERTY(int columnFixedWidth READ columnFixedWidth WRITE setColumnFixedWidth) + +public: + GridLayoutAttached(QObject *parent); + + int row() const { return _row; } + void setRow(int r); + + int column() const { return _column; } + void setColumn(int c); + + int rowSpan() const { return _rowspan; } + void setRowSpan(int rs); + + int columnSpan() const { return _colspan; } + void setColumnSpan(int cs); + + Qt::Alignment alignment() const { return _alignment; } + void setAlignment(Qt::Alignment a); + + int rowStretchFactor() const { return _rowstretch; } + void setRowStretchFactor(int f); + int columnStretchFactor() const { return _colstretch; } + void setColumnStretchFactor(int f); + + int rowSpacing() const { return _rowspacing; } + void setRowSpacing(int s); + int columnSpacing() const { return _colspacing; } + void setColumnSpacing(int s); + + int rowPreferredHeight() const { return _rowprefheight; } + void setRowPreferredHeight(int s) { _rowprefheight = s; } + + int rowMaximumHeight() const { return _rowmaxheight; } + void setRowMaximumHeight(int s) { _rowmaxheight = s; } + + int rowMinimumHeight() const { return _rowminheight; } + void setRowMinimumHeight(int s) { _rowminheight = s; } + + int rowFixedHeight() const { return _rowfixheight; } + void setRowFixedHeight(int s) { _rowfixheight = s; } + + int columnPreferredWidth() const { return _colprefwidth; } + void setColumnPreferredWidth(int s) { _colprefwidth = s; } + + int columnMaximumWidth() const { return _colmaxwidth; } + void setColumnMaximumWidth(int s) { _colmaxwidth = s; } + + int columnMinimumWidth() const { return _colminwidth; } + void setColumnMinimumWidth(int s) { _colminwidth = s; } + + int columnFixedWidth() const { return _colfixwidth; } + void setColumnFixedWidth(int s) { _colfixwidth = s; } + +Q_SIGNALS: + void alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment); + +private: + int _row; + int _column; + int _rowspan; + int _colspan; + Qt::Alignment _alignment; + int _rowstretch; + int _colstretch; + int _rowspacing; + int _colspacing; + int _rowprefheight; + int _rowmaxheight; + int _rowminheight; + int _rowfixheight; + int _colprefwidth; + int _colmaxwidth; + int _colminwidth; + int _colfixwidth; +}; + +QT_END_NAMESPACE + +QML_DECLARE_INTERFACE(QGraphicsLayoutItem) +QML_DECLARE_INTERFACE(QGraphicsLayout) +QML_DECLARE_TYPE(QGraphicsLinearLayoutStretchItemObject) +QML_DECLARE_TYPE(QGraphicsLinearLayoutObject) +QML_DECLARE_TYPEINFO(QGraphicsLinearLayoutObject, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(QGraphicsGridLayoutObject) +QML_DECLARE_TYPEINFO(QGraphicsGridLayoutObject, QML_HAS_ATTACHED_PROPERTIES) + +QT_END_HEADER + +#endif // GRAPHICSLAYOUTS_H diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/main.cpp new file mode 100644 index 0000000..89b69bf --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/main.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> +#include <QtDeclarative/qdeclarative.h> +#include "graphicslayouts_p.h" +#include <QtDeclarative/QDeclarativeView> + +int main(int argc, char* argv[]) +{ + QApplication app(argc, argv); + QDeclarativeView view; + qmlRegisterInterface<QGraphicsLayoutItem>("QGraphicsLayoutItem"); + qmlRegisterInterface<QGraphicsLayout>("QGraphicsLayout"); + qmlRegisterType<QGraphicsLinearLayoutStretchItemObject>("GraphicsLayouts",4,7,"QGraphicsLinearLayoutStretchItem"); + qmlRegisterType<QGraphicsLinearLayoutObject>("GraphicsLayouts",4,7,"QGraphicsLinearLayout"); + qmlRegisterType<QGraphicsGridLayoutObject>("GraphicsLayouts",4,7,"QGraphicsGridLayout"); + view.setSource(QUrl(":graphicslayouts.qml")); + view.show(); + return app.exec(); +}; + diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro new file mode 100644 index 0000000..4a3fc73 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro @@ -0,0 +1,13 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Tue May 4 13:36:26 2010 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . +QT += declarative + +# Input +SOURCES += main.cpp +RESOURCES += layoutItem.qrc diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml new file mode 100644 index 0000000..460c564 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml @@ -0,0 +1,15 @@ +import Qt 4.7 + +LayoutItem {//Sized by the layout + id: resizable + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { color: "yellow"; anchors.fill: parent } + Rectangle { + width: 100; height: 100; + anchors.top: parent.top; + anchors.right: parent.right; + color: "green"; + } +} diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qrc b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qrc new file mode 100644 index 0000000..deb0fba --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>layoutItem.qml</file> +</qresource> +</RCC> diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp new file mode 100644 index 0000000..a104251 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> +#include <QGraphicsView> +#include <QGraphicsScene> +#include <QGraphicsWidget> +#include <QGraphicsLinearLayout> +#include <QDeclarativeComponent> +#include <QDeclarativeEngine> + +/* This example demonstrates using a LayoutItem to let QML snippets integrate + nicely with existing QGraphicsView applications designed with GraphicsLayouts +*/ +int main(int argc, char* argv[]) +{ + QApplication app(argc, argv); + //Set up a graphics scene with a QGraphicsWidget and Layout + QGraphicsView view; + QGraphicsScene scene; + QGraphicsWidget *widget = new QGraphicsWidget(); + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(); + widget->setLayout(layout); + scene.addItem(widget); + view.setScene(&scene); + //Add the QML snippet into the layout + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl(":layoutItem.qml")); + QGraphicsLayoutItem* obj = qobject_cast<QGraphicsLayoutItem*>(c.create()); + layout->addItem(obj); + + widget->setGeometry(QRectF(0,0, 400,400)); + view.show(); + return app.exec(); +} diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro new file mode 100644 index 0000000..d92a6f4 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + graphicsLayouts \ + layoutItem diff --git a/examples/declarative/velocity/velocity.qmlproject b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/velocity/velocity.qmlproject +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject diff --git a/examples/declarative/extending/adding/adding.pro b/examples/declarative/cppextensions/referenceexamples/adding/adding.pro index 6072de4..6072de4 100644 --- a/examples/declarative/extending/adding/adding.pro +++ b/examples/declarative/cppextensions/referenceexamples/adding/adding.pro diff --git a/examples/declarative/extending/adding/adding.qrc b/examples/declarative/cppextensions/referenceexamples/adding/adding.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/adding/adding.qrc +++ b/examples/declarative/cppextensions/referenceexamples/adding/adding.qrc diff --git a/examples/declarative/extending/adding/example.qml b/examples/declarative/cppextensions/referenceexamples/adding/example.qml index dc891e7..dc891e7 100644 --- a/examples/declarative/extending/adding/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/adding/example.qml diff --git a/examples/declarative/extending/adding/main.cpp b/examples/declarative/cppextensions/referenceexamples/adding/main.cpp index 7b33895..7b33895 100644 --- a/examples/declarative/extending/adding/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/adding/main.cpp diff --git a/examples/declarative/extending/adding/person.cpp b/examples/declarative/cppextensions/referenceexamples/adding/person.cpp index cdf08e0..cdf08e0 100644 --- a/examples/declarative/extending/adding/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/adding/person.cpp diff --git a/examples/declarative/extending/adding/person.h b/examples/declarative/cppextensions/referenceexamples/adding/person.h index d6de9a9..d6de9a9 100644 --- a/examples/declarative/extending/adding/person.h +++ b/examples/declarative/cppextensions/referenceexamples/adding/person.h diff --git a/examples/declarative/extending/attached/attached.pro b/examples/declarative/cppextensions/referenceexamples/attached/attached.pro index f6d76ed..f6d76ed 100644 --- a/examples/declarative/extending/attached/attached.pro +++ b/examples/declarative/cppextensions/referenceexamples/attached/attached.pro diff --git a/examples/declarative/extending/attached/attached.qrc b/examples/declarative/cppextensions/referenceexamples/attached/attached.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/attached/attached.qrc +++ b/examples/declarative/cppextensions/referenceexamples/attached/attached.qrc diff --git a/examples/declarative/extending/attached/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp index 7fa1748..7fa1748 100644 --- a/examples/declarative/extending/attached/birthdayparty.cpp +++ b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp diff --git a/examples/declarative/extending/attached/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h index 1c66f8c..1c66f8c 100644 --- a/examples/declarative/extending/attached/birthdayparty.h +++ b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h diff --git a/examples/declarative/extending/attached/example.qml b/examples/declarative/cppextensions/referenceexamples/attached/example.qml index 50f0a32..50f0a32 100644 --- a/examples/declarative/extending/attached/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/attached/example.qml diff --git a/examples/declarative/extending/attached/main.cpp b/examples/declarative/cppextensions/referenceexamples/attached/main.cpp index f1055ae..f1055ae 100644 --- a/examples/declarative/extending/attached/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/attached/main.cpp diff --git a/examples/declarative/extending/valuesource/person.cpp b/examples/declarative/cppextensions/referenceexamples/attached/person.cpp index 0a9e508..0a9e508 100644 --- a/examples/declarative/extending/valuesource/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/attached/person.cpp diff --git a/examples/declarative/extending/valuesource/person.h b/examples/declarative/cppextensions/referenceexamples/attached/person.h index 2f444c5..2f444c5 100644 --- a/examples/declarative/extending/valuesource/person.h +++ b/examples/declarative/cppextensions/referenceexamples/attached/person.h diff --git a/examples/declarative/extending/binding/binding.pro b/examples/declarative/cppextensions/referenceexamples/binding/binding.pro index 896ce25..896ce25 100644 --- a/examples/declarative/extending/binding/binding.pro +++ b/examples/declarative/cppextensions/referenceexamples/binding/binding.pro diff --git a/examples/declarative/extending/binding/binding.qrc b/examples/declarative/cppextensions/referenceexamples/binding/binding.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/binding/binding.qrc +++ b/examples/declarative/cppextensions/referenceexamples/binding/binding.qrc diff --git a/examples/declarative/extending/binding/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp index 000bb1f..000bb1f 100644 --- a/examples/declarative/extending/binding/birthdayparty.cpp +++ b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp diff --git a/examples/declarative/extending/binding/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h index c3f033e..c3f033e 100644 --- a/examples/declarative/extending/binding/birthdayparty.h +++ b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h diff --git a/examples/declarative/extending/binding/example.qml b/examples/declarative/cppextensions/referenceexamples/binding/example.qml index 82eb3be..82eb3be 100644 --- a/examples/declarative/extending/binding/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/binding/example.qml diff --git a/examples/declarative/extending/binding/happybirthdaysong.cpp b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp index a40e7fb..a40e7fb 100644 --- a/examples/declarative/extending/binding/happybirthdaysong.cpp +++ b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp diff --git a/examples/declarative/extending/binding/happybirthdaysong.h b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h index e825b86..e825b86 100644 --- a/examples/declarative/extending/binding/happybirthdaysong.h +++ b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h diff --git a/examples/declarative/extending/binding/main.cpp b/examples/declarative/cppextensions/referenceexamples/binding/main.cpp index 2495676..2495676 100644 --- a/examples/declarative/extending/binding/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/binding/main.cpp diff --git a/examples/declarative/extending/binding/person.cpp b/examples/declarative/cppextensions/referenceexamples/binding/person.cpp index 9a2248f..9a2248f 100644 --- a/examples/declarative/extending/binding/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/binding/person.cpp diff --git a/examples/declarative/extending/binding/person.h b/examples/declarative/cppextensions/referenceexamples/binding/person.h index 2a68da0..2a68da0 100644 --- a/examples/declarative/extending/binding/person.h +++ b/examples/declarative/cppextensions/referenceexamples/binding/person.h diff --git a/examples/declarative/extending/grouped/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp index 4f415a3..4f415a3 100644 --- a/examples/declarative/extending/grouped/birthdayparty.cpp +++ b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp diff --git a/examples/declarative/extending/coercion/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h index ee77e9a..ee77e9a 100644 --- a/examples/declarative/extending/coercion/birthdayparty.h +++ b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h diff --git a/examples/declarative/extending/coercion/coercion.pro b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro index c8daed8..c8daed8 100644 --- a/examples/declarative/extending/coercion/coercion.pro +++ b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro diff --git a/examples/declarative/extending/coercion/coercion.qrc b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/coercion/coercion.qrc +++ b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc diff --git a/examples/declarative/extending/coercion/example.qml b/examples/declarative/cppextensions/referenceexamples/coercion/example.qml index 7b45950..7b45950 100644 --- a/examples/declarative/extending/coercion/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/coercion/example.qml diff --git a/examples/declarative/extending/coercion/main.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/main.cpp index 2c7b545..2c7b545 100644 --- a/examples/declarative/extending/coercion/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/coercion/main.cpp diff --git a/examples/declarative/extending/coercion/person.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/person.cpp index 5b5203a..5b5203a 100644 --- a/examples/declarative/extending/coercion/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/coercion/person.cpp diff --git a/examples/declarative/extending/coercion/person.h b/examples/declarative/cppextensions/referenceexamples/coercion/person.h index 1c95da7..1c95da7 100644 --- a/examples/declarative/extending/coercion/person.h +++ b/examples/declarative/cppextensions/referenceexamples/coercion/person.h diff --git a/examples/declarative/extending/default/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp index 4f415a3..4f415a3 100644 --- a/examples/declarative/extending/default/birthdayparty.cpp +++ b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp diff --git a/examples/declarative/extending/default/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h index 9741040..9741040 100644 --- a/examples/declarative/extending/default/birthdayparty.h +++ b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h diff --git a/examples/declarative/extending/default/default.pro b/examples/declarative/cppextensions/referenceexamples/default/default.pro index 32aff0b..32aff0b 100644 --- a/examples/declarative/extending/default/default.pro +++ b/examples/declarative/cppextensions/referenceexamples/default/default.pro diff --git a/examples/declarative/extending/default/default.qrc b/examples/declarative/cppextensions/referenceexamples/default/default.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/default/default.qrc +++ b/examples/declarative/cppextensions/referenceexamples/default/default.qrc diff --git a/examples/declarative/extending/default/example.qml b/examples/declarative/cppextensions/referenceexamples/default/example.qml index c0f3cbb..c0f3cbb 100644 --- a/examples/declarative/extending/default/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/default/example.qml diff --git a/examples/declarative/extending/default/main.cpp b/examples/declarative/cppextensions/referenceexamples/default/main.cpp index 2ffd180..2ffd180 100644 --- a/examples/declarative/extending/default/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/default/main.cpp diff --git a/examples/declarative/extending/default/person.cpp b/examples/declarative/cppextensions/referenceexamples/default/person.cpp index 69216d3..69216d3 100644 --- a/examples/declarative/extending/default/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/default/person.cpp diff --git a/examples/declarative/extending/default/person.h b/examples/declarative/cppextensions/referenceexamples/default/person.h index 3e56860..3e56860 100644 --- a/examples/declarative/extending/default/person.h +++ b/examples/declarative/cppextensions/referenceexamples/default/person.h diff --git a/examples/declarative/extending/extended/example.qml b/examples/declarative/cppextensions/referenceexamples/extended/example.qml index 985ce20..985ce20 100644 --- a/examples/declarative/extending/extended/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/extended/example.qml diff --git a/examples/declarative/extending/extended/extended.pro b/examples/declarative/cppextensions/referenceexamples/extended/extended.pro index 97af286..97af286 100644 --- a/examples/declarative/extending/extended/extended.pro +++ b/examples/declarative/cppextensions/referenceexamples/extended/extended.pro diff --git a/examples/declarative/extending/extended/extended.qrc b/examples/declarative/cppextensions/referenceexamples/extended/extended.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/extended/extended.qrc +++ b/examples/declarative/cppextensions/referenceexamples/extended/extended.qrc diff --git a/examples/declarative/extending/extended/lineedit.cpp b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp index 0e521ec..0e521ec 100644 --- a/examples/declarative/extending/extended/lineedit.cpp +++ b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp diff --git a/examples/declarative/extending/extended/lineedit.h b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.h index 3a464b0..3a464b0 100644 --- a/examples/declarative/extending/extended/lineedit.h +++ b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.h diff --git a/examples/declarative/extending/extended/main.cpp b/examples/declarative/cppextensions/referenceexamples/extended/main.cpp index ca7242d..ca7242d 100644 --- a/examples/declarative/extending/extended/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/extended/main.cpp diff --git a/examples/declarative/extending/coercion/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp index 4f415a3..4f415a3 100644 --- a/examples/declarative/extending/coercion/birthdayparty.cpp +++ b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp diff --git a/examples/declarative/extending/grouped/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h index 31d21b2..31d21b2 100644 --- a/examples/declarative/extending/grouped/birthdayparty.h +++ b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h diff --git a/examples/declarative/extending/grouped/example.qml b/examples/declarative/cppextensions/referenceexamples/grouped/example.qml index 91b7a06..91b7a06 100644 --- a/examples/declarative/extending/grouped/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/grouped/example.qml diff --git a/examples/declarative/extending/grouped/grouped.pro b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro index 576e1d2..576e1d2 100644 --- a/examples/declarative/extending/grouped/grouped.pro +++ b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro diff --git a/examples/declarative/extending/grouped/grouped.qrc b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/grouped/grouped.qrc +++ b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc diff --git a/examples/declarative/extending/grouped/main.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/main.cpp index baf32cf..baf32cf 100644 --- a/examples/declarative/extending/grouped/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/grouped/main.cpp diff --git a/examples/declarative/extending/signal/person.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/person.cpp index 0a9e508..0a9e508 100644 --- a/examples/declarative/extending/signal/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/grouped/person.cpp diff --git a/examples/declarative/extending/grouped/person.h b/examples/declarative/cppextensions/referenceexamples/grouped/person.h index a031e69..a031e69 100644 --- a/examples/declarative/extending/grouped/person.h +++ b/examples/declarative/cppextensions/referenceexamples/grouped/person.h diff --git a/examples/declarative/extending/properties/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp index 27d17a1..27d17a1 100644 --- a/examples/declarative/extending/properties/birthdayparty.cpp +++ b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp diff --git a/examples/declarative/extending/properties/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h index 39ce9ba..39ce9ba 100644 --- a/examples/declarative/extending/properties/birthdayparty.h +++ b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h diff --git a/examples/declarative/extending/properties/example.qml b/examples/declarative/cppextensions/referenceexamples/properties/example.qml index 35abdd6..35abdd6 100644 --- a/examples/declarative/extending/properties/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/properties/example.qml diff --git a/examples/declarative/extending/properties/main.cpp b/examples/declarative/cppextensions/referenceexamples/properties/main.cpp index 85e9584..85e9584 100644 --- a/examples/declarative/extending/properties/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/properties/main.cpp diff --git a/examples/declarative/extending/properties/person.cpp b/examples/declarative/cppextensions/referenceexamples/properties/person.cpp index 92c54f5..92c54f5 100644 --- a/examples/declarative/extending/properties/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/properties/person.cpp diff --git a/examples/declarative/extending/properties/person.h b/examples/declarative/cppextensions/referenceexamples/properties/person.h index 0029b09..0029b09 100644 --- a/examples/declarative/extending/properties/person.h +++ b/examples/declarative/cppextensions/referenceexamples/properties/person.h diff --git a/examples/declarative/extending/properties/properties.pro b/examples/declarative/cppextensions/referenceexamples/properties/properties.pro index a8f4301..a8f4301 100644 --- a/examples/declarative/extending/properties/properties.pro +++ b/examples/declarative/cppextensions/referenceexamples/properties/properties.pro diff --git a/examples/declarative/extending/properties/properties.qrc b/examples/declarative/cppextensions/referenceexamples/properties/properties.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/properties/properties.qrc +++ b/examples/declarative/cppextensions/referenceexamples/properties/properties.qrc diff --git a/examples/declarative/extending/extending.pro b/examples/declarative/cppextensions/referenceexamples/referenceexamples.pro index 169c7ab..169c7ab 100644 --- a/examples/declarative/extending/extending.pro +++ b/examples/declarative/cppextensions/referenceexamples/referenceexamples.pro diff --git a/examples/declarative/tvtennis/tvtennis.qmlproject b/examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/tvtennis/tvtennis.qmlproject +++ b/examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject diff --git a/examples/declarative/extending/signal/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp index 740c8c9..740c8c9 100644 --- a/examples/declarative/extending/signal/birthdayparty.cpp +++ b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp diff --git a/examples/declarative/extending/signal/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h index ae4dd39..ae4dd39 100644 --- a/examples/declarative/extending/signal/birthdayparty.h +++ b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h diff --git a/examples/declarative/extending/signal/example.qml b/examples/declarative/cppextensions/referenceexamples/signal/example.qml index 83d6a23..83d6a23 100644 --- a/examples/declarative/extending/signal/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/signal/example.qml diff --git a/examples/declarative/extending/signal/main.cpp b/examples/declarative/cppextensions/referenceexamples/signal/main.cpp index 453f688..453f688 100644 --- a/examples/declarative/extending/signal/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/signal/main.cpp diff --git a/examples/declarative/extending/grouped/person.cpp b/examples/declarative/cppextensions/referenceexamples/signal/person.cpp index 0a9e508..0a9e508 100644 --- a/examples/declarative/extending/grouped/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/signal/person.cpp diff --git a/examples/declarative/extending/signal/person.h b/examples/declarative/cppextensions/referenceexamples/signal/person.h index 2f444c5..2f444c5 100644 --- a/examples/declarative/extending/signal/person.h +++ b/examples/declarative/cppextensions/referenceexamples/signal/person.h diff --git a/examples/declarative/extending/signal/signal.pro b/examples/declarative/cppextensions/referenceexamples/signal/signal.pro index 6367a38..6367a38 100644 --- a/examples/declarative/extending/signal/signal.pro +++ b/examples/declarative/cppextensions/referenceexamples/signal/signal.pro diff --git a/examples/declarative/extending/signal/signal.qrc b/examples/declarative/cppextensions/referenceexamples/signal/signal.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/signal/signal.qrc +++ b/examples/declarative/cppextensions/referenceexamples/signal/signal.qrc diff --git a/examples/declarative/extending/valuesource/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp index b915f4f..b915f4f 100644 --- a/examples/declarative/extending/valuesource/birthdayparty.cpp +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp diff --git a/examples/declarative/extending/valuesource/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h index 5f25781..5f25781 100644 --- a/examples/declarative/extending/valuesource/birthdayparty.h +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h diff --git a/examples/declarative/extending/valuesource/example.qml b/examples/declarative/cppextensions/referenceexamples/valuesource/example.qml index 5b8c8af..5b8c8af 100644 --- a/examples/declarative/extending/valuesource/example.qml +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/example.qml diff --git a/examples/declarative/extending/valuesource/happybirthdaysong.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp index 8ea5c2b..8ea5c2b 100644 --- a/examples/declarative/extending/valuesource/happybirthdaysong.cpp +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp diff --git a/examples/declarative/extending/valuesource/happybirthdaysong.h b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h index 3d07909..3d07909 100644 --- a/examples/declarative/extending/valuesource/happybirthdaysong.h +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h diff --git a/examples/declarative/extending/valuesource/main.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp index 00840ee..00840ee 100644 --- a/examples/declarative/extending/valuesource/main.cpp +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp diff --git a/examples/declarative/extending/attached/person.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp index 0a9e508..0a9e508 100644 --- a/examples/declarative/extending/attached/person.cpp +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp diff --git a/examples/declarative/extending/attached/person.h b/examples/declarative/cppextensions/referenceexamples/valuesource/person.h index 2f444c5..2f444c5 100644 --- a/examples/declarative/extending/attached/person.h +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/person.h diff --git a/examples/declarative/extending/valuesource/valuesource.pro b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro index 0626c98..0626c98 100644 --- a/examples/declarative/extending/valuesource/valuesource.pro +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro diff --git a/examples/declarative/extending/valuesource/valuesource.qrc b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc index e2fa01d..e2fa01d 100644 --- a/examples/declarative/extending/valuesource/valuesource.qrc +++ b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro index e37c3d4..e3d922c 100644 --- a/examples/declarative/declarative.pro +++ b/examples/declarative/declarative.pro @@ -2,51 +2,28 @@ TEMPLATE = subdirs # These examples contain some C++ and need to be built SUBDIRS = \ - extending \ - imageprovider \ - objectlistmodel \ - stringlistmodel \ - plugins \ - proxywidgets + cppextensions \ + modelviews \ + tutorials # plugins uses a 'Time' class that conflicts with symbian e32std.h also defining a class of the same name symbian:SUBDIRS -= plugins # These examples contain no C++ and can simply be copied sources.files = \ - animations \ - aspectratio \ - behaviors \ - border-image \ - clocks \ - connections \ - dial \ - dynamic \ - effects \ - fillmode \ - focus \ - fonts \ - gridview \ - layouts \ - listview \ - mousearea \ - package \ - parallax \ - progressbar \ - scrollbar \ - searchbox \ - slideswitch \ - sql \ - states \ - tabwidget \ - tic-tac-toe \ - tutorials \ - tvtennis \ - velocity \ - webview \ - workerlistmodel \ - workerscript \ - xmldata \ - xmlhttprequest + animation \ + cppextensions \ + i18n \ + imageelements \ + keyinteraction \ + positioners \ + sqllocalstorage \ + text \ + threading \ + touchinteraction \ + toys \ + ui-components \ + xml + sources.path = $$[QT_INSTALL_EXAMPLES]/declarative INSTALLS += sources diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml deleted file mode 100644 index 0e6e197..0000000 --- a/examples/declarative/dynamic/dynamic.qml +++ /dev/null @@ -1,157 +0,0 @@ -import Qt 4.7 -import Qt.labs.particles 1.0 -import "qml" - -Item { - id: window - //This is a desktop-sized example - width: 1024; height: 512 - property int activeSuns: 0 - - //This is the message that pops up when there's an error - Rectangle{ - id: dialog - opacity: 0 - anchors.centerIn: parent - width: dialogText.width + 6 - height: dialogText.height + 6 - border.color: 'black' - color: 'lightsteelblue' - z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones. - function show(str){ - dialogText.text = str; - dialogAnim.start(); - } - Text{ - id: dialogText - x:3 - y:3 - font.pixelSize: 14 - } - SequentialAnimation{ - id: dialogAnim - NumberAnimation{target: dialog; property:"opacity"; to: 1; duration: 1000} - PauseAnimation{duration: 5000} - NumberAnimation{target: dialog; property:"opacity"; to: 0; duration: 1000} - } - } - - // sky - Rectangle { id: sky - anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter } - gradient: Gradient { - GradientStop { id: stopA; position: 0.0; color: "#0E1533" } - GradientStop { id: stopB; position: 1.0; color: "#437284" } - } - } - - // stars (when there's no sun) - Particles { - id: stars - x: 0; y: 0; width: parent.width; height: parent.height / 2 - source: "images/star.png"; angleDeviation: 360; velocity: 0 - velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800 - opacity: 1 - } - - // ground, which has a z such that the sun can set behind it - Rectangle { - id: ground - z: 2 - anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.right; bottom: parent.bottom } - gradient: Gradient { - GradientStop { position: 0.0; color: "ForestGreen" } - GradientStop { position: 1.0; color: "DarkGreen" } - } - } - - //Day state, for when you place a sun - states: State { - name: "Day"; when: window.activeSuns > 0 - PropertyChanges { target: stopA; color: "DeepSkyBlue"} - PropertyChanges { target: stopB; color: "SkyBlue"} - PropertyChanges { target: stars; opacity: 0 } - } - - transitions: Transition { - PropertyAnimation { duration: 3000 } - ColorAnimation { duration: 3000 } - } - - SystemPalette { id: activePalette } - - // toolbox - Rectangle { - id: toolbox - z: 3 //Above ground - color: activePalette.window; - width: 480 - anchors { right: parent.right; top:parent.top; bottom: parent.bottom } - Rectangle { //Not a child of any positioner - border.color: "black"; - width: toolRow.width + 4 - height: toolRow.height + 4 - x: toolboxPositioner.x + toolRow.x - 2 - y: toolboxPositioner.y + toolRow.y - 2 - } - Column { - id: toolboxPositioner - anchors.centerIn: parent - spacing: 8 - Text { text: "Drag an item into the scene." } - Row { - id: toolRow - spacing: 8; - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - file: "Sun.qml"; - image: "../images/sun.png" - } - PaletteItem { - file: "GenericItem.qml" - image: "../images/moon.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - file: "PerspectiveItem.qml" - image: "../images/tree_s.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - file: "PerspectiveItem.qml" - image: "../images/rabbit_brown.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - file: "PerspectiveItem.qml" - image: "../images/rabbit_bw.png" - } - } - Text { text: "Active Suns: " + activeSuns } - Rectangle { width: 440; height: 1; color: "black" } - Text { text: "Arbitrary QML: " } - TextEdit { - id: qmlText - width: 460 - height: 220 - readOnly: false - focusOnPress: true - font.pixelSize: 14 - - text: "import Qt 4.7\nImage {\n id: smile;\n x: 500*Math.random();\n y: 200*Math.random(); \n source: 'images/face-smile.png';\n NumberAnimation on opacity { \n to: 0; duration: 1500;\n }\n Component.onCompleted: smile.destroy(1500);\n}" - } - Button { - text: "Create" - function makeCustom() { - try{ - Qt.createQmlObject(qmlText.text, window, 'CustomObject'); - }catch(err){ - dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message ); - } - } - onClicked: makeCustom(); - } - } - } - -} diff --git a/examples/declarative/dynamic/qml/Button.qml b/examples/declarative/dynamic/qml/Button.qml deleted file mode 100644 index 53588bb..0000000 --- a/examples/declarative/dynamic/qml/Button.qml +++ /dev/null @@ -1,24 +0,0 @@ -import Qt 4.7 - -Rectangle { - id: container - - property variant text - signal clicked - - SystemPalette { id: activePalette } - height: text.height + 10 - width: text.width + 20 - border.width: 1 - radius: 4; smooth: true - gradient: Gradient { - GradientStop { position: 0.0; - color: if(!mr.pressed){activePalette.light;}else{activePalette.button;} - } - GradientStop { position: 1.0; - color: if(!mr.pressed){activePalette.button;}else{activePalette.dark;} - } - } - MouseArea { id:mr; anchors.fill: parent; onClicked: container.clicked() } - Text { id: text; anchors.centerIn:parent; font.pointSize: 10; text: parent.text; color: activePalette.buttonText } -} diff --git a/examples/declarative/dynamic/qml/GenericItem.qml b/examples/declarative/dynamic/qml/GenericItem.qml deleted file mode 100644 index faac06d..0000000 --- a/examples/declarative/dynamic/qml/GenericItem.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Qt 4.7 - -Item{ - property bool created: false - property string image - width: imageItem.width - height: imageItem.height - z: 2 - Image{ - id: imageItem - source: image; - } -} diff --git a/examples/declarative/dynamic/qml/PaletteItem.qml b/examples/declarative/dynamic/qml/PaletteItem.qml deleted file mode 100644 index e8f2ed4..0000000 --- a/examples/declarative/dynamic/qml/PaletteItem.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Qt 4.7 -import "itemCreation.js" as Code - -GenericItem { - id: itemButton - property string file - MouseArea { - anchors.fill: parent; - onPressed: Code.startDrag(mouse); - onPositionChanged: Code.moveDrag(mouse); - onReleased: Code.endDrag(mouse); - } -} diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml deleted file mode 100644 index 3cbe64a..0000000 --- a/examples/declarative/dynamic/qml/PerspectiveItem.qml +++ /dev/null @@ -1,16 +0,0 @@ -import Qt 4.7 - -Image { - id: tree - property bool created: false - property double scaleFactor: Math.max((y+height-250)*0.01, 0.3) - property double scaledBottom: y + (height+height*scaleFactor)/2 - property bool onLand: scaledBottom > window.height/2 - property string image //Needed for compatibility with GenericItem - opacity: onLand ? 1 : 0.25 - onCreatedChanged: if (created && !onLand) { tree.destroy() } else { z = scaledBottom } - scale: scaleFactor - transformOrigin: "Center" - source: image; smooth: true - onYChanged: z = scaledBottom -} diff --git a/examples/declarative/dynamic/qml/Sun.qml b/examples/declarative/dynamic/qml/Sun.qml deleted file mode 100644 index 3627964..0000000 --- a/examples/declarative/dynamic/qml/Sun.qml +++ /dev/null @@ -1,24 +0,0 @@ -import Qt 4.7 - -Image { - id: sun - property bool created: false - property string image: "../images/sun.png" - onCreatedChanged: if(created){window.activeSuns++;}else{window.activeSuns--;} - - source: image; - z: 1 - - //x and y get set when instantiated - //head offscreen - NumberAnimation on y { - to: window.height / 2; - running: created - onRunningChanged: if (running) duration = (window.height - sun.y) * 10; else state = "OffScreen"; - } - - states: State { - name: "OffScreen"; - StateChangeScript { script: { sun.created = false; sun.destroy() } } - } -} diff --git a/examples/declarative/dynamic/qml/itemCreation.js b/examples/declarative/dynamic/qml/itemCreation.js deleted file mode 100644 index 98d48a8..0000000 --- a/examples/declarative/dynamic/qml/itemCreation.js +++ /dev/null @@ -1,82 +0,0 @@ -var itemComponent = null; -var draggedItem = null; -var startingMouse; -var startingZ; -//Until QT-2385 is resolved we need to convert to scene coordinates manually -var xOffset; -var yOffset; -function setSceneOffset() -{ - xOffset = 0; - yOffset = 0; - var p = itemButton; - while(p != window){ - xOffset += p.x; - yOffset += p.y; - p = p.parent; - } -} - -function startDrag(mouse) -{ - setSceneOffset(); - startingMouse = { x: mouse.x, y: mouse.y } - loadComponent(); -} - -//Creation is split into two functions due to an asyncronous wait while -//possible external files are loaded. - -function loadComponent() { - if (itemComponent != null) //Already loaded the component - createItem(); - - itemComponent = Qt.createComponent(itemButton.file); - //console.log(itemButton.file) - if(itemComponent.isLoading){ - component.statusChanged.connect(finishCreation); - }else{//Depending on the content, it can be ready or error immediately - createItem(); - } -} - -function createItem() { - if (itemComponent.isReady && draggedItem == null) { - draggedItem = itemComponent.createObject(); - draggedItem.parent = window; - draggedItem.image = itemButton.image; - draggedItem.x = xOffset; - draggedItem.y = yOffset; - startingZ = draggedItem.z; - draggedItem.z = 4;//On top - } else if (itemComponent.isError) { - draggedItem = null; - console.log("error creating component"); - console.log(component.errorsString()); - } -} - -function moveDrag(mouse) -{ - if(draggedItem == null) - return; - - draggedItem.x = mouse.x + xOffset - startingMouse.x; - draggedItem.y = mouse.y + yOffset - startingMouse.y; -} - -function endDrag(mouse) -{ - if(draggedItem == null) - return; - - if(draggedItem.x + draggedItem.width > toolbox.x){ //Don't drop it in the toolbox - draggedItem.destroy(); - draggedItem = null; - }else{ - draggedItem.z = startingZ; - draggedItem.created = true; - draggedItem = null; - } -} - diff --git a/examples/declarative/fillmode/content/QtLogo.qml b/examples/declarative/fillmode/content/QtLogo.qml deleted file mode 100644 index 6dd714d..0000000 --- a/examples/declarative/fillmode/content/QtLogo.qml +++ /dev/null @@ -1,30 +0,0 @@ -import Qt 4.7 - -Item { - id: qtLogo - - property alias fillMode: image.fillMode - property alias label: labelText.text - - width: ((window.width - 20) - ((grid.columns - 1) * grid.spacing)) / grid.columns - height: ((window.height - 20) - ((grid.rows - 1) * grid.spacing)) / grid.rows - - Column { - anchors.fill: parent - - Rectangle { - height: qtLogo.height - 30; width: qtLogo.width - border.color: "black"; clip: true - - Image { - id: image - anchors.fill: parent; smooth: true; source: "qt-logo.png" - } - } - - Text { - id: labelText; anchors.horizontalCenter: parent.horizontalCenter - height: 30; verticalAlignment: Text.AlignVCenter - } - } -} diff --git a/examples/declarative/fillmode/content/qt-logo.png b/examples/declarative/fillmode/content/qt-logo.png Binary files differdeleted file mode 100644 index 14ddf2a..0000000 --- a/examples/declarative/fillmode/content/qt-logo.png +++ /dev/null diff --git a/examples/declarative/fillmode/fillmode.qml b/examples/declarative/fillmode/fillmode.qml deleted file mode 100644 index e5b0336..0000000 --- a/examples/declarative/fillmode/fillmode.qml +++ /dev/null @@ -1,22 +0,0 @@ -import Qt 4.7 -import "content" - -Rectangle { - id: window - - width: 800; height: 480 - color: "#cdcdcd" - - Grid { - id: grid - anchors { fill: parent; topMargin: 10; leftMargin: 10; rightMargin: 10; bottomMargin: 10 } - columns: 3; rows: 2; spacing: 20 - - QtLogo { fillMode: Image.Stretch; label: "Stretch" } - QtLogo { fillMode: Image.PreserveAspectFit; label: "PreserveAspectFit" } - QtLogo { fillMode: Image.PreserveAspectCrop; label: "PreserveAspectCrop" } - QtLogo { fillMode: Image.Tile; label: "Tile" } - QtLogo { fillMode: Image.TileHorizontally; label: "TileHorizontally" } - QtLogo { fillMode: Image.TileVertically; label: "TileVertically" } - } -} diff --git a/examples/declarative/i18n/i18n.qml b/examples/declarative/i18n/i18n.qml new file mode 100644 index 0000000..c3030b2 --- /dev/null +++ b/examples/declarative/i18n/i18n.qml @@ -0,0 +1,37 @@ +import Qt 4.7 + +// +// The QML runtime automatically loads a translation from the i18n subdirectory of the root +// QML file, based on the system language. +// +// The files are created/updated by running: +// +// lupdate i18n.qml -ts i18n/base.ts +// +// Translations for new languages are created by copying i18n/base.ts to i18n/qml_<lang>.ts +// The .ts files can then be edited with Linguist: +// +// linguist i18n/qml_fr.ts +// +// The run-time translation files are then generaeted by running: +// +// lrelease i18n/*.ts +// + +Rectangle { + width: 640; height: 480 + + Column { + anchors.fill: parent; spacing: 20 + + Text { + text: "If a translation is available for the system language (eg. French) then the string below will translated (eg. 'Bonjour'). Otherwise is will show 'Hello'." + width: parent.width; wrapMode: Text.WordWrap + } + + Text { + text: qsTr("Hello") + font.pointSize: 25; anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject b/examples/declarative/i18n/i18n.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject +++ b/examples/declarative/i18n/i18n.qmlproject diff --git a/examples/declarative/i18n/i18n/base.ts b/examples/declarative/i18n/i18n/base.ts new file mode 100644 index 0000000..82547a1 --- /dev/null +++ b/examples/declarative/i18n/i18n/base.ts @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" sourcelanguage="en"> +<context> + <name>i18n</name> + <message> + <location filename="../i18n.qml" line="30"/> + <source>Hello</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/examples/declarative/i18n/i18n/qml_en_AU.qm b/examples/declarative/i18n/i18n/qml_en_AU.qm Binary files differnew file mode 100644 index 0000000..fb8b710 --- /dev/null +++ b/examples/declarative/i18n/i18n/qml_en_AU.qm diff --git a/examples/declarative/i18n/i18n/qml_en_AU.ts b/examples/declarative/i18n/i18n/qml_en_AU.ts new file mode 100644 index 0000000..e991aff --- /dev/null +++ b/examples/declarative/i18n/i18n/qml_en_AU.ts @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="en_AU" sourcelanguage="en"> +<context> + <name>i18n</name> + <message> + <location filename="../i18n.qml" line="30"/> + <source>Hello</source> + <translation>G'day</translation> + </message> +</context> +</TS> diff --git a/examples/declarative/i18n/i18n/qml_fr.qm b/examples/declarative/i18n/i18n/qml_fr.qm Binary files differnew file mode 100644 index 0000000..583562e --- /dev/null +++ b/examples/declarative/i18n/i18n/qml_fr.qm diff --git a/examples/declarative/i18n/i18n/qml_fr.ts b/examples/declarative/i18n/i18n/qml_fr.ts new file mode 100644 index 0000000..365abd9 --- /dev/null +++ b/examples/declarative/i18n/i18n/qml_fr.ts @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="fr" sourcelanguage="en"> +<context> + <name>i18n</name> + <message> + <location filename="../i18n.qml" line="30"/> + <source>Hello</source> + <translation>Bonjour</translation> + </message> +</context> +</TS> diff --git a/examples/declarative/imageelements/borderimage/borderimage.qml b/examples/declarative/imageelements/borderimage/borderimage.qml new file mode 100644 index 0000000..c334cea --- /dev/null +++ b/examples/declarative/imageelements/borderimage/borderimage.qml @@ -0,0 +1,57 @@ +import Qt 4.7 +import "content" + +Rectangle { + id: page + width: 1030; height: 540 + + Grid { + anchors.centerIn: parent; spacing: 20 + + MyBorderImage { + minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240 + source: "content/colors.png"; margin: 30 + } + + MyBorderImage { + minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240 + source: "content/colors.png"; margin: 30 + horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat + } + + MyBorderImage { + minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240 + source: "content/colors.png"; margin: 30 + horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat + } + + MyBorderImage { + minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240 + source: "content/colors.png"; margin: 30 + horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round + } + + MyBorderImage { + minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200 + source: "content/bw.png"; margin: 10 + } + + MyBorderImage { + minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200 + source: "content/bw.png"; margin: 10 + horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat + } + + MyBorderImage { + minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200 + source: "content/bw.png"; margin: 10 + horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat + } + + MyBorderImage { + minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200 + source: "content/bw.png"; margin: 10 + horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round + } + } +} diff --git a/examples/declarative/tabwidget/tabwidget.qmlproject b/examples/declarative/imageelements/borderimage/borderimage.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/tabwidget/tabwidget.qmlproject +++ b/examples/declarative/imageelements/borderimage/borderimage.qmlproject diff --git a/examples/declarative/imageelements/borderimage/content/MyBorderImage.qml b/examples/declarative/imageelements/borderimage/content/MyBorderImage.qml new file mode 100644 index 0000000..b47df7b --- /dev/null +++ b/examples/declarative/imageelements/borderimage/content/MyBorderImage.qml @@ -0,0 +1,50 @@ +import Qt 4.7 + +Item { + id: container + + property alias horizontalMode: image.horizontalTileMode + property alias verticalMode: image.verticalTileMode + property alias source: image.source + + property int minWidth + property int minHeight + property int maxWidth + property int maxHeight + property int margin + + width: 240; height: 240 + + BorderImage { + id: image; anchors.centerIn: parent + + SequentialAnimation on width { + loops: Animation.Infinite + NumberAnimation { + from: container.minWidth; to: container.maxWidth + duration: 2000; easing.type: Easing.InOutQuad + } + NumberAnimation { + from: container.maxWidth; to: container.minWidth + duration: 2000; easing.type: Easing.InOutQuad + } + } + + SequentialAnimation on height { + loops: Animation.Infinite + NumberAnimation { + from: container.minHeight; to: container.maxHeight + duration: 2000; easing.type: Easing.InOutQuad + } + NumberAnimation { + from: container.maxHeight; to: container.minHeight + duration: 2000; easing.type: Easing.InOutQuad + } + } + + border.top: container.margin + border.left: container.margin + border.bottom: container.margin + border.right: container.margin + } +} diff --git a/examples/declarative/imageelements/borderimage/content/ShadowRectangle.qml b/examples/declarative/imageelements/borderimage/content/ShadowRectangle.qml new file mode 100644 index 0000000..629478b --- /dev/null +++ b/examples/declarative/imageelements/borderimage/content/ShadowRectangle.qml @@ -0,0 +1,14 @@ +import Qt 4.7 + +Item { + property alias color : rectangle.color + + BorderImage { + anchors.fill: rectangle + anchors { leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } + border { left: 10; top: 10; right: 10; bottom: 10 } + source: "shadow.png"; smooth: true + } + + Rectangle { id: rectangle; anchors.fill: parent } +} diff --git a/examples/declarative/border-image/content/bw.png b/examples/declarative/imageelements/borderimage/content/bw.png Binary files differindex 486eaae..486eaae 100644 --- a/examples/declarative/border-image/content/bw.png +++ b/examples/declarative/imageelements/borderimage/content/bw.png diff --git a/examples/declarative/border-image/content/colors-round.sci b/examples/declarative/imageelements/borderimage/content/colors-round.sci index 506f6f5..506f6f5 100644 --- a/examples/declarative/border-image/content/colors-round.sci +++ b/examples/declarative/imageelements/borderimage/content/colors-round.sci diff --git a/examples/declarative/border-image/content/colors-stretch.sci b/examples/declarative/imageelements/borderimage/content/colors-stretch.sci index e4989a7..e4989a7 100644 --- a/examples/declarative/border-image/content/colors-stretch.sci +++ b/examples/declarative/imageelements/borderimage/content/colors-stretch.sci diff --git a/examples/declarative/border-image/content/colors.png b/examples/declarative/imageelements/borderimage/content/colors.png Binary files differindex dfb62f3..dfb62f3 100644 --- a/examples/declarative/border-image/content/colors.png +++ b/examples/declarative/imageelements/borderimage/content/colors.png diff --git a/examples/declarative/imageelements/borderimage/content/shadow.png b/examples/declarative/imageelements/borderimage/content/shadow.png Binary files differnew file mode 100644 index 0000000..431af85 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/content/shadow.png diff --git a/examples/declarative/imageelements/borderimage/shadows.qml b/examples/declarative/imageelements/borderimage/shadows.qml new file mode 100644 index 0000000..a08d133 --- /dev/null +++ b/examples/declarative/imageelements/borderimage/shadows.qml @@ -0,0 +1,24 @@ +import Qt 4.7 +import "content" + +Rectangle { + id: window + + width: 480; height: 320 + color: "gray" + + ShadowRectangle { + anchors.centerIn: parent; width: 250; height: 250 + color: "lightsteelblue" + } + + ShadowRectangle { + anchors.centerIn: parent; width: 200; height: 200 + color: "steelblue" + } + + ShadowRectangle { + anchors.centerIn: parent; width: 150; height: 150 + color: "thistle" + } +} diff --git a/examples/declarative/aspectratio/face_fit.qml b/examples/declarative/imageelements/image/face_fit.qml index 52cd4c2..52cd4c2 100644 --- a/examples/declarative/aspectratio/face_fit.qml +++ b/examples/declarative/imageelements/image/face_fit.qml diff --git a/examples/declarative/aspectratio/face_fit_animated.qml b/examples/declarative/imageelements/image/face_fit_animated.qml index 63fc9c6..63fc9c6 100644 --- a/examples/declarative/aspectratio/face_fit_animated.qml +++ b/examples/declarative/imageelements/image/face_fit_animated.qml diff --git a/examples/declarative/sql/sql.qmlproject b/examples/declarative/imageelements/image/image.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/sql/sql.qmlproject +++ b/examples/declarative/imageelements/image/image.qmlproject diff --git a/examples/declarative/aspectratio/pics/face.png b/examples/declarative/imageelements/image/pics/face.png Binary files differindex 3d66d72..3d66d72 100644 --- a/examples/declarative/aspectratio/pics/face.png +++ b/examples/declarative/imageelements/image/pics/face.png diff --git a/examples/declarative/aspectratio/scale_and_crop.qml b/examples/declarative/imageelements/image/scale_and_crop.qml index a438104..a438104 100644 --- a/examples/declarative/aspectratio/scale_and_crop.qml +++ b/examples/declarative/imageelements/image/scale_and_crop.qml diff --git a/examples/declarative/aspectratio/scale_and_crop_simple.qml b/examples/declarative/imageelements/image/scale_and_crop_simple.qml index 1160ec5..1160ec5 100644 --- a/examples/declarative/aspectratio/scale_and_crop_simple.qml +++ b/examples/declarative/imageelements/image/scale_and_crop_simple.qml diff --git a/examples/declarative/aspectratio/scale_and_sidecrop.qml b/examples/declarative/imageelements/image/scale_and_sidecrop.qml index 5593ab8..5593ab8 100644 --- a/examples/declarative/aspectratio/scale_and_sidecrop.qml +++ b/examples/declarative/imageelements/image/scale_and_sidecrop.qml diff --git a/examples/declarative/aspectratio/scale_to_fit.qml b/examples/declarative/imageelements/image/scale_to_fit.qml index 724a36e..724a36e 100644 --- a/examples/declarative/aspectratio/scale_to_fit.qml +++ b/examples/declarative/imageelements/image/scale_to_fit.qml diff --git a/examples/declarative/aspectratio/scale_to_fit_simple.qml b/examples/declarative/imageelements/image/scale_to_fit_simple.qml index 0e960b4..0e960b4 100644 --- a/examples/declarative/aspectratio/scale_to_fit_simple.qml +++ b/examples/declarative/imageelements/image/scale_to_fit_simple.qml diff --git a/examples/declarative/slideswitch/slideswitch.qmlproject b/examples/declarative/imageelements/imageelements.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/slideswitch/slideswitch.qmlproject +++ b/examples/declarative/imageelements/imageelements.qmlproject diff --git a/examples/declarative/images/content/lemonade.jpg b/examples/declarative/images/content/lemonade.jpg Binary files differdeleted file mode 100644 index db445c9..0000000 --- a/examples/declarative/images/content/lemonade.jpg +++ /dev/null diff --git a/examples/declarative/images/images.qml b/examples/declarative/images/images.qml deleted file mode 100644 index e48ad50..0000000 --- a/examples/declarative/images/images.qml +++ /dev/null @@ -1,72 +0,0 @@ -import Qt 4.7 - -Rectangle { - color: "white" - width: grid.width + 50 - height: grid.height + 50 - - Grid { - id: grid - x: 25; y: 25 - columns: 3 - - Image { - source: "content/lemonade.jpg" - } - - Image { - sourceSize.width: 50 - sourceSize.height: 50 - source: "content/lemonade.jpg" - } - - Image { - sourceSize.width: 50 - sourceSize.height: 50 - smooth: true - source: "content/lemonade.jpg" - } - - Image { - scale: 1/3 - source: "content/lemonade.jpg" - } - - Image { - scale: 1/3 - sourceSize.width: 50 - sourceSize.height: 50 - source: "content/lemonade.jpg" - } - - Image { - scale: 1/3 - sourceSize.width: 50 - sourceSize.height: 50 - smooth: true - source: "content/lemonade.jpg" - } - - Image { - width: 50; height: 50 - transform: Translate { x: 50 } - source: "content/lemonade.jpg" - } - - Image { - width: 50; height: 50 - transform: Translate { x: 50 } - sourceSize.width: 50 - sourceSize.height: 50 - source: "content/lemonade.jpg" - } - - Image { - width: 50; height: 50 - transform: Translate { x: 50 } - sourceSize: "50x50" // syntactic sugar - smooth: true - source: "content/lemonade.jpg" - } - } -} diff --git a/examples/declarative/focus/Core/ContextMenu.qml b/examples/declarative/keyinteraction/focus/Core/ContextMenu.qml index 49a54bc..49a54bc 100644 --- a/examples/declarative/focus/Core/ContextMenu.qml +++ b/examples/declarative/keyinteraction/focus/Core/ContextMenu.qml diff --git a/examples/declarative/focus/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml index 3f727fd..3f727fd 100644 --- a/examples/declarative/focus/Core/GridMenu.qml +++ b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml diff --git a/examples/declarative/focus/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml index 14e2548..14e2548 100644 --- a/examples/declarative/focus/Core/ListViewDelegate.qml +++ b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml diff --git a/examples/declarative/focus/Core/ListViews.qml b/examples/declarative/keyinteraction/focus/Core/ListViews.qml index 089f821..32a5d4c 100644 --- a/examples/declarative/focus/Core/ListViews.qml +++ b/examples/declarative/keyinteraction/focus/Core/ListViews.qml @@ -14,7 +14,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } @@ -26,7 +26,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } @@ -38,7 +38,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } diff --git a/examples/declarative/focus/Core/images/arrow.png b/examples/declarative/keyinteraction/focus/Core/images/arrow.png Binary files differindex 14978c2..14978c2 100644 --- a/examples/declarative/focus/Core/images/arrow.png +++ b/examples/declarative/keyinteraction/focus/Core/images/arrow.png diff --git a/examples/declarative/focus/Core/images/qt-logo.png b/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png Binary files differindex 14ddf2a..14ddf2a 100644 --- a/examples/declarative/focus/Core/images/qt-logo.png +++ b/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png diff --git a/examples/declarative/focus/Core/qmldir b/examples/declarative/keyinteraction/focus/Core/qmldir index e25d63c..e25d63c 100644 --- a/examples/declarative/focus/Core/qmldir +++ b/examples/declarative/keyinteraction/focus/Core/qmldir diff --git a/examples/declarative/focus/focus.qml b/examples/declarative/keyinteraction/focus/focus.qml index 22b0e50..8c992ae 100644 --- a/examples/declarative/focus/focus.qml +++ b/examples/declarative/keyinteraction/focus/focus.qml @@ -38,7 +38,7 @@ Rectangle { } transitions: Transition { - NumberAnimation { properties: "y"; duration: 600; easing.type: "OutQuint" } + NumberAnimation { properties: "y"; duration: 600; easing.type: Easing.OutQuint } } } @@ -64,6 +64,6 @@ Rectangle { } transitions: Transition { - NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: "OutQuint" } + NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: Easing.OutQuint } } } diff --git a/examples/declarative/focus/focus.qmlproject b/examples/declarative/keyinteraction/focus/focus.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/focus/focus.qmlproject +++ b/examples/declarative/keyinteraction/focus/focus.qmlproject diff --git a/examples/declarative/searchbox/searchbox.qmlproject b/examples/declarative/keyinteraction/keyinteraction.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/searchbox/searchbox.qmlproject +++ b/examples/declarative/keyinteraction/keyinteraction.qmlproject diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml deleted file mode 100644 index 0f08893..0000000 --- a/examples/declarative/layouts/Button.qml +++ /dev/null @@ -1,22 +0,0 @@ -import Qt 4.7 - -Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + textelement.width + 13; height: pix.height + 10; id: page - property string text - property string icon - signal clicked - - Image { id: pix; x: 5; y:5; source: parent.icon} - Text { id: textelement; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;} - MouseArea{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}} - - states: - State{ name:"pressed"; when:mr.pressed - PropertyChanges {target:textelement; x: 5} - PropertyChanges {target:pix; x:textelement.x+textelement.width + 3} - } - - transitions: - Transition{ - NumberAnimation { properties:"x,left"; easing.type:"InOutQuad"; duration:200 } - } -} diff --git a/examples/declarative/layouts/layouts.qml b/examples/declarative/layouts/layouts.qml deleted file mode 100644 index 391eab7..0000000 --- a/examples/declarative/layouts/layouts.qml +++ /dev/null @@ -1,29 +0,0 @@ -import Qt 4.7 -import Qt.widgets 4.7 - -Item { - id: resizable - - width: 400 - height: 400 - - QGraphicsWidget { - size.width: parent.width - size.height: parent.height - - layout: QGraphicsLinearLayout { - LayoutItem { - minimumSize: "100x100" - maximumSize: "300x300" - preferredSize: "100x100" - Rectangle { color: "yellow"; anchors.fill: parent } - } - LayoutItem { - minimumSize: "100x100" - maximumSize: "400x400" - preferredSize: "200x200" - Rectangle { color: "green"; anchors.fill: parent } - } - } - } -} diff --git a/examples/declarative/gridview/gridview-example.qml b/examples/declarative/modelviews/gridview/gridview-example.qml index a5f41fb..a5f41fb 100644 --- a/examples/declarative/gridview/gridview-example.qml +++ b/examples/declarative/modelviews/gridview/gridview-example.qml diff --git a/examples/declarative/gridview/gridview.qmlproject b/examples/declarative/modelviews/gridview/gridview.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/gridview/gridview.qmlproject +++ b/examples/declarative/modelviews/gridview/gridview.qmlproject diff --git a/examples/declarative/gridview/pics/AddressBook_48.png b/examples/declarative/modelviews/gridview/pics/AddressBook_48.png Binary files differindex 1ab7c8e..1ab7c8e 100644 --- a/examples/declarative/gridview/pics/AddressBook_48.png +++ b/examples/declarative/modelviews/gridview/pics/AddressBook_48.png diff --git a/examples/declarative/gridview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png Binary files differindex f4b8689..f4b8689 100644 --- a/examples/declarative/gridview/pics/AudioPlayer_48.png +++ b/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png diff --git a/examples/declarative/gridview/pics/Camera_48.png b/examples/declarative/modelviews/gridview/pics/Camera_48.png Binary files differindex c76b524..c76b524 100644 --- a/examples/declarative/gridview/pics/Camera_48.png +++ b/examples/declarative/modelviews/gridview/pics/Camera_48.png diff --git a/examples/declarative/gridview/pics/DateBook_48.png b/examples/declarative/modelviews/gridview/pics/DateBook_48.png Binary files differindex 58f5787..58f5787 100644 --- a/examples/declarative/gridview/pics/DateBook_48.png +++ b/examples/declarative/modelviews/gridview/pics/DateBook_48.png diff --git a/examples/declarative/gridview/pics/EMail_48.png b/examples/declarative/modelviews/gridview/pics/EMail_48.png Binary files differindex d6d84a6..d6d84a6 100644 --- a/examples/declarative/gridview/pics/EMail_48.png +++ b/examples/declarative/modelviews/gridview/pics/EMail_48.png diff --git a/examples/declarative/gridview/pics/TodoList_48.png b/examples/declarative/modelviews/gridview/pics/TodoList_48.png Binary files differindex 0988448..0988448 100644 --- a/examples/declarative/gridview/pics/TodoList_48.png +++ b/examples/declarative/modelviews/gridview/pics/TodoList_48.png diff --git a/examples/declarative/gridview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png Binary files differindex 52638c5..52638c5 100644 --- a/examples/declarative/gridview/pics/VideoPlayer_48.png +++ b/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png diff --git a/examples/declarative/listview/content/ClickAutoRepeating.qml b/examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml index f65c2b3..f65c2b3 100644 --- a/examples/declarative/listview/content/ClickAutoRepeating.qml +++ b/examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml diff --git a/examples/declarative/listview/content/MediaButton.qml b/examples/declarative/modelviews/listview/content/MediaButton.qml index a625b4c..a625b4c 100644 --- a/examples/declarative/listview/content/MediaButton.qml +++ b/examples/declarative/modelviews/listview/content/MediaButton.qml diff --git a/examples/declarative/listview/content/pics/add.png b/examples/declarative/modelviews/listview/content/pics/add.png Binary files differindex f29d84b..f29d84b 100644 --- a/examples/declarative/listview/content/pics/add.png +++ b/examples/declarative/modelviews/listview/content/pics/add.png diff --git a/examples/declarative/listview/content/pics/archive-insert.png b/examples/declarative/modelviews/listview/content/pics/archive-insert.png Binary files differindex b706248..b706248 100644 --- a/examples/declarative/listview/content/pics/archive-insert.png +++ b/examples/declarative/modelviews/listview/content/pics/archive-insert.png diff --git a/examples/declarative/listview/content/pics/archive-remove.png b/examples/declarative/modelviews/listview/content/pics/archive-remove.png Binary files differindex 9640f6b..9640f6b 100644 --- a/examples/declarative/listview/content/pics/archive-remove.png +++ b/examples/declarative/modelviews/listview/content/pics/archive-remove.png diff --git a/examples/declarative/listview/content/pics/button-pressed.png b/examples/declarative/modelviews/listview/content/pics/button-pressed.png Binary files differindex e434d32..e434d32 100644 --- a/examples/declarative/listview/content/pics/button-pressed.png +++ b/examples/declarative/modelviews/listview/content/pics/button-pressed.png diff --git a/examples/declarative/listview/content/pics/button.png b/examples/declarative/modelviews/listview/content/pics/button.png Binary files differindex 56a63ce..56a63ce 100644 --- a/examples/declarative/listview/content/pics/button.png +++ b/examples/declarative/modelviews/listview/content/pics/button.png diff --git a/examples/declarative/listview/content/pics/del.png b/examples/declarative/modelviews/listview/content/pics/del.png Binary files differindex 1d753a3..1d753a3 100644 --- a/examples/declarative/listview/content/pics/del.png +++ b/examples/declarative/modelviews/listview/content/pics/del.png diff --git a/examples/declarative/listview/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg Binary files differindex da5a6b1..da5a6b1 100644 --- a/examples/declarative/listview/content/pics/fruit-salad.jpg +++ b/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg diff --git a/examples/declarative/listview/content/pics/go-down.png b/examples/declarative/modelviews/listview/content/pics/go-down.png Binary files differindex 63331a5..63331a5 100644 --- a/examples/declarative/listview/content/pics/go-down.png +++ b/examples/declarative/modelviews/listview/content/pics/go-down.png diff --git a/examples/declarative/listview/content/pics/go-up.png b/examples/declarative/modelviews/listview/content/pics/go-up.png Binary files differindex 4459024..4459024 100644 --- a/examples/declarative/listview/content/pics/go-up.png +++ b/examples/declarative/modelviews/listview/content/pics/go-up.png diff --git a/examples/declarative/listview/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/content/pics/hamburger.jpg Binary files differindex d0a15be..d0a15be 100644 --- a/examples/declarative/listview/content/pics/hamburger.jpg +++ b/examples/declarative/modelviews/listview/content/pics/hamburger.jpg diff --git a/examples/declarative/listview/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/content/pics/lemonade.jpg Binary files differindex db445c9..db445c9 100644 --- a/examples/declarative/listview/content/pics/lemonade.jpg +++ b/examples/declarative/modelviews/listview/content/pics/lemonade.jpg diff --git a/examples/declarative/listview/content/pics/list-add.png b/examples/declarative/modelviews/listview/content/pics/list-add.png Binary files differindex e029787..e029787 100644 --- a/examples/declarative/listview/content/pics/list-add.png +++ b/examples/declarative/modelviews/listview/content/pics/list-add.png diff --git a/examples/declarative/listview/content/pics/list-remove.png b/examples/declarative/modelviews/listview/content/pics/list-remove.png Binary files differindex 2bb1a59..2bb1a59 100644 --- a/examples/declarative/listview/content/pics/list-remove.png +++ b/examples/declarative/modelviews/listview/content/pics/list-remove.png diff --git a/examples/declarative/listview/content/pics/moreDown.png b/examples/declarative/modelviews/listview/content/pics/moreDown.png Binary files differindex 31a35d5..31a35d5 100644 --- a/examples/declarative/listview/content/pics/moreDown.png +++ b/examples/declarative/modelviews/listview/content/pics/moreDown.png diff --git a/examples/declarative/listview/content/pics/moreUp.png b/examples/declarative/modelviews/listview/content/pics/moreUp.png Binary files differindex fefb9c9..fefb9c9 100644 --- a/examples/declarative/listview/content/pics/moreUp.png +++ b/examples/declarative/modelviews/listview/content/pics/moreUp.png diff --git a/examples/declarative/listview/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/content/pics/pancakes.jpg Binary files differindex 60c4396..60c4396 100644 --- a/examples/declarative/listview/content/pics/pancakes.jpg +++ b/examples/declarative/modelviews/listview/content/pics/pancakes.jpg diff --git a/examples/declarative/listview/content/pics/trash.png b/examples/declarative/modelviews/listview/content/pics/trash.png Binary files differindex 2042595..2042595 100644 --- a/examples/declarative/listview/content/pics/trash.png +++ b/examples/declarative/modelviews/listview/content/pics/trash.png diff --git a/examples/declarative/listview/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg Binary files differindex 9dce332..9dce332 100644 --- a/examples/declarative/listview/content/pics/vegetable-soup.jpg +++ b/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg diff --git a/examples/declarative/listview/dummydata/MyPetsModel.qml b/examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml index f15dda3..f15dda3 100644 --- a/examples/declarative/listview/dummydata/MyPetsModel.qml +++ b/examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml diff --git a/examples/declarative/listview/dummydata/Recipes.qml b/examples/declarative/modelviews/listview/dummydata/Recipes.qml index f707c82..f707c82 100644 --- a/examples/declarative/listview/dummydata/Recipes.qml +++ b/examples/declarative/modelviews/listview/dummydata/Recipes.qml diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/modelviews/listview/dynamic.qml index 236a9c5..693e88a 100644 --- a/examples/declarative/listview/dynamic.qml +++ b/examples/declarative/modelviews/listview/dynamic.qml @@ -1,6 +1,6 @@ import Qt 4.7 import "content" -import "../scrollbar" +import "../../ui-components/scrollbar" Rectangle { id: container @@ -56,7 +56,7 @@ Rectangle { Item { width: container.width; height: 55 - + Column { id: moveButtons x: 5; width: childrenRect.width; anchors.verticalCenter: parent.verticalCenter @@ -84,7 +84,7 @@ Rectangle { spacing: 5 Repeater { model: attributes - Component { + Component { Text { text: description; color: "White" } } } @@ -95,13 +95,12 @@ Rectangle { id: itemButtons anchors { right: removeButton.left; rightMargin: 35; verticalCenter: parent.verticalCenter } - width: childrenRect.width + width: childrenRect.width spacing: 10 Image { source: "content/pics/list-add.png" scale: clickUp.isPressed ? 0.9 : 1 - transformOrigin: Item.Center ClickAutoRepeating { id: clickUp @@ -115,9 +114,8 @@ Rectangle { Image { source: "content/pics/list-remove.png" scale: clickDown.isPressed ? 0.9 : 1 - transformOrigin: Item.Center - ClickAutoRepeating { + ClickAutoRepeating { id: clickDown anchors.fill: parent onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25)) @@ -147,18 +145,18 @@ Rectangle { width: 8; height: view.height; anchors.right: view.right opacity: 0 - orientation: "Vertical" + orientation: Qt.Vertical position: view.visibleArea.yPosition pageSize: view.visibleArea.heightRatio // Only show the scrollbar when the view is moving. states: State { - name: "ShowBars"; when: view.moving + name: "ShowBars"; when: view.movingVertically PropertyChanges { target: verticalScrollBar; opacity: 1 } } transitions: Transition { NumberAnimation { properties: "opacity"; duration: 400 } - } + } } Row { @@ -198,10 +196,10 @@ Rectangle { } } - Image { + Image { source: "content/pics/archive-remove.png" - MouseArea { + MouseArea { anchors.fill: parent onClicked: fruitModel.clear() } diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/modelviews/listview/highlight.qml index 50ba2f7..ade355d 100644 --- a/examples/declarative/listview/highlight.qml +++ b/examples/declarative/modelviews/listview/highlight.qml @@ -4,7 +4,7 @@ Rectangle { width: 400; height: 300 // MyPets model is defined in dummydata/MyPetsModel.qml - // The viewer automatically loads files in dummydata/* to assist + // The launcher automatically loads files in dummydata/* to assist // development without a real data source. // This one contains my pets. diff --git a/examples/declarative/listview/itemlist.qml b/examples/declarative/modelviews/listview/itemlist.qml index e387f28..b73b3a3 100644 --- a/examples/declarative/listview/itemlist.qml +++ b/examples/declarative/modelviews/listview/itemlist.qml @@ -33,7 +33,7 @@ Rectangle { anchors { fill: parent; bottomMargin: 30 } model: itemModel preferredHighlightBegin: 0; preferredHighlightEnd: 0 - highlightRangeMode: "StrictlyEnforceRange" + highlightRangeMode: ListView.StrictlyEnforceRange orientation: ListView.Horizontal snapMode: ListView.SnapOneItem; flickDeceleration: 2000 } @@ -55,7 +55,7 @@ Rectangle { radius: 3 color: view.currentIndex == index ? "blue" : "white" - MouseArea { + MouseArea { width: 20; height: 20 anchors.centerIn: parent onClicked: view.currentIndex = index diff --git a/examples/declarative/listview/listview-example.qml b/examples/declarative/modelviews/listview/listview-example.qml index 6feedf6..2e8cdda 100644 --- a/examples/declarative/listview/listview-example.qml +++ b/examples/declarative/modelviews/listview/listview-example.qml @@ -75,7 +75,7 @@ Rectangle { highlight: petHighlight currentIndex: list1.currentIndex preferredHighlightBegin: 80; preferredHighlightEnd: 220 - highlightRangeMode: "ApplyRange" + highlightRangeMode: ListView.ApplyRange } ListView { @@ -87,7 +87,7 @@ Rectangle { highlight: Rectangle { color: "lightsteelblue" } currentIndex: list1.currentIndex preferredHighlightBegin: 125; preferredHighlightEnd: 125 - highlightRangeMode: "StrictlyEnforceRange" + highlightRangeMode: ListView.StrictlyEnforceRange flickDeceleration: 1000 } } diff --git a/examples/declarative/listview/listview.qmlproject b/examples/declarative/modelviews/listview/listview.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/listview/listview.qmlproject +++ b/examples/declarative/modelviews/listview/listview.qmlproject diff --git a/examples/declarative/listview/recipes.qml b/examples/declarative/modelviews/listview/recipes.qml index 990e272..990e272 100644 --- a/examples/declarative/listview/recipes.qml +++ b/examples/declarative/modelviews/listview/recipes.qml diff --git a/examples/declarative/listview/sections.qml b/examples/declarative/modelviews/listview/sections.qml index 0a81f63..21f9f03 100644 --- a/examples/declarative/listview/sections.qml +++ b/examples/declarative/modelviews/listview/sections.qml @@ -61,7 +61,7 @@ Rectangle { height: 20 Text { x: 2; height: parent.height - verticalAlignment: 'AlignVCenter' + verticalAlignment: Text.AlignVCenter text: section font.bold: true } diff --git a/examples/declarative/modelviews/modelviews.pro b/examples/declarative/modelviews/modelviews.pro new file mode 100644 index 0000000..b811e44 --- /dev/null +++ b/examples/declarative/modelviews/modelviews.pro @@ -0,0 +1,7 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + objectlistmodel \ + stringlistmodel + + diff --git a/examples/declarative/scrollbar/scrollbar.qmlproject b/examples/declarative/modelviews/modelviews.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/scrollbar/scrollbar.qmlproject +++ b/examples/declarative/modelviews/modelviews.qmlproject diff --git a/examples/declarative/objectlistmodel/dataobject.cpp b/examples/declarative/modelviews/objectlistmodel/dataobject.cpp index 4c44ee4..14be1b9 100644 --- a/examples/declarative/objectlistmodel/dataobject.cpp +++ b/examples/declarative/modelviews/objectlistmodel/dataobject.cpp @@ -59,7 +59,10 @@ QString DataObject::name() const void DataObject::setName(const QString &name) { - m_name = name; + if (name != m_name) { + m_name = name; + emit nameChanged(); + } } QString DataObject::color() const @@ -69,5 +72,8 @@ QString DataObject::color() const void DataObject::setColor(const QString &color) { - m_color = color; + if (color != m_color) { + m_color = color; + emit colorChanged(); + } } diff --git a/examples/declarative/objectlistmodel/dataobject.h b/examples/declarative/modelviews/objectlistmodel/dataobject.h index 6804474..852110d 100644 --- a/examples/declarative/objectlistmodel/dataobject.h +++ b/examples/declarative/modelviews/objectlistmodel/dataobject.h @@ -48,8 +48,8 @@ class DataObject : public QObject { Q_OBJECT - Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(QString color READ color WRITE setColor) + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) + Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged) public: DataObject(QObject *parent=0); @@ -61,6 +61,10 @@ public: QString color() const; void setColor(const QString &color); +signals: + void nameChanged(); + void colorChanged(); + private: QString m_name; QString m_color; diff --git a/examples/declarative/objectlistmodel/main.cpp b/examples/declarative/modelviews/objectlistmodel/main.cpp index b210570..b210570 100644 --- a/examples/declarative/objectlistmodel/main.cpp +++ b/examples/declarative/modelviews/objectlistmodel/main.cpp diff --git a/examples/declarative/objectlistmodel/objectlistmodel.pro b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro index 869cde3..869cde3 100644 --- a/examples/declarative/objectlistmodel/objectlistmodel.pro +++ b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro diff --git a/examples/declarative/objectlistmodel/objectlistmodel.qmlproject b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/objectlistmodel/objectlistmodel.qmlproject +++ b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject diff --git a/examples/declarative/objectlistmodel/objectlistmodel.qrc b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qrc index 17e9301..17e9301 100644 --- a/examples/declarative/objectlistmodel/objectlistmodel.qrc +++ b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qrc diff --git a/examples/declarative/objectlistmodel/view.qml b/examples/declarative/modelviews/objectlistmodel/view.qml index 908e388..2b8383f 100644 --- a/examples/declarative/objectlistmodel/view.qml +++ b/examples/declarative/modelviews/objectlistmodel/view.qml @@ -9,7 +9,7 @@ ListView { Rectangle { height: 25 width: 100 - color: model.color + color: model.modelData.color Text { text: name } } } diff --git a/examples/declarative/package/Delegate.qml b/examples/declarative/modelviews/package/Delegate.qml index 785fde6..785fde6 100644 --- a/examples/declarative/package/Delegate.qml +++ b/examples/declarative/modelviews/package/Delegate.qml diff --git a/examples/declarative/package/package.qmlproject b/examples/declarative/modelviews/package/package.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/package/package.qmlproject +++ b/examples/declarative/modelviews/package/package.qmlproject diff --git a/examples/declarative/package/view.qml b/examples/declarative/modelviews/package/view.qml index 67f896b..67f896b 100644 --- a/examples/declarative/package/view.qml +++ b/examples/declarative/modelviews/package/view.qml diff --git a/examples/declarative/parallax/parallax.qml b/examples/declarative/modelviews/parallax/parallax.qml index cb0437d..110f17e 100644 --- a/examples/declarative/parallax/parallax.qml +++ b/examples/declarative/modelviews/parallax/parallax.qml @@ -1,5 +1,5 @@ import Qt 4.7 -import "../clocks/content" +import "../../toys/clocks/content" import "qml" Rectangle { @@ -31,8 +31,8 @@ Rectangle { Loader { anchors { top: parent.top; topMargin: 10; horizontalCenter: parent.horizontalCenter } width: 300; height: 400 - clip: true; resizeMode: Loader.SizeItemToLoader - source: "../../../demos/declarative/samegame/samegame.qml" + clip: true; + source: "../../../../demos/declarative/samegame/samegame.qml" } } diff --git a/examples/declarative/parallax/parallax.qmlproject b/examples/declarative/modelviews/parallax/parallax.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/parallax/parallax.qmlproject +++ b/examples/declarative/modelviews/parallax/parallax.qmlproject diff --git a/examples/declarative/parallax/pics/background.jpg b/examples/declarative/modelviews/parallax/pics/background.jpg Binary files differindex 61cca2f..61cca2f 100644 --- a/examples/declarative/parallax/pics/background.jpg +++ b/examples/declarative/modelviews/parallax/pics/background.jpg diff --git a/examples/declarative/dynamic/images/face-smile.png b/examples/declarative/modelviews/parallax/pics/face-smile.png Binary files differindex 3d66d72..3d66d72 100644 --- a/examples/declarative/dynamic/images/face-smile.png +++ b/examples/declarative/modelviews/parallax/pics/face-smile.png diff --git a/examples/declarative/parallax/pics/home-page.svg b/examples/declarative/modelviews/parallax/pics/home-page.svg index 4f16958..4f16958 100644 --- a/examples/declarative/parallax/pics/home-page.svg +++ b/examples/declarative/modelviews/parallax/pics/home-page.svg diff --git a/examples/declarative/animations/images/shadow.png b/examples/declarative/modelviews/parallax/pics/shadow.png Binary files differindex 8270565..8270565 100644 --- a/examples/declarative/animations/images/shadow.png +++ b/examples/declarative/modelviews/parallax/pics/shadow.png diff --git a/examples/declarative/parallax/pics/yast-joystick.png b/examples/declarative/modelviews/parallax/pics/yast-joystick.png Binary files differindex 858cea0..858cea0 100644 --- a/examples/declarative/parallax/pics/yast-joystick.png +++ b/examples/declarative/modelviews/parallax/pics/yast-joystick.png diff --git a/examples/declarative/parallax/pics/yast-wol.png b/examples/declarative/modelviews/parallax/pics/yast-wol.png Binary files differindex 7712180..7712180 100644 --- a/examples/declarative/parallax/pics/yast-wol.png +++ b/examples/declarative/modelviews/parallax/pics/yast-wol.png diff --git a/examples/declarative/parallax/qml/ParallaxView.qml b/examples/declarative/modelviews/parallax/qml/ParallaxView.qml index 4b38d45..e869a21 100644 --- a/examples/declarative/parallax/qml/ParallaxView.qml +++ b/examples/declarative/modelviews/parallax/qml/ParallaxView.qml @@ -18,9 +18,9 @@ Item { id: list currentIndex: root.currentIndex - onCurrentIndexChanged: root.currentIndex = currentIndex + onCurrentIndexChanged: root.currentIndex = currentIndex - orientation: "Horizontal" + orientation: Qt.Horizontal boundsBehavior: Flickable.DragOverBounds anchors.fill: parent model: VisualItemModel { id: visualModel } @@ -45,10 +45,10 @@ Item { anchors.horizontalCenter: parent.horizontalCenter width: Math.min(count * 50, parent.width - 20) interactive: width == parent.width - 20 - orientation: "Horizontal" + orientation: Qt.Horizontal - delegate: Item { - width: 50; height: 50 + delegate: Item { + width: 50; height: 50 id: delegateRoot Image { @@ -56,7 +56,6 @@ Item { source: modelData.icon smooth: true scale: 0.8 - transformOrigin: "Center" } MouseArea { @@ -64,10 +63,10 @@ Item { onClicked: { root.currentIndex = index } } - states: State { + states: State { name: "Selected" when: delegateRoot.ListView.isCurrentItem == true - PropertyChanges { + PropertyChanges { target: image scale: 1 y: -5 diff --git a/examples/declarative/parallax/qml/Smiley.qml b/examples/declarative/modelviews/parallax/qml/Smiley.qml index b1e1ae8..662addc 100644 --- a/examples/declarative/parallax/qml/Smiley.qml +++ b/examples/declarative/modelviews/parallax/qml/Smiley.qml @@ -8,7 +8,6 @@ Item { Image { anchors.horizontalCenter: parent.horizontalCenter source: "../pics/shadow.png"; y: smiley.minHeight + 58 - transformOrigin: Item.Center // The scale property depends on the y position of the smiley face. scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) @@ -30,13 +29,13 @@ Item { // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function NumberAnimation { from: smiley.minHeight; to: smiley.maxHeight - easing.type: "OutExpo"; duration: 300 + easing.type: Easing.OutExpo; duration: 300 } - + // Then move back to minHeight in 1 second, using the OutBounce easing function NumberAnimation { from: smiley.maxHeight; to: smiley.minHeight - easing.type: "OutBounce"; duration: 1000 + easing.type: Easing.OutBounce; duration: 1000 } // Then pause for 500ms diff --git a/examples/declarative/stringlistmodel/main.cpp b/examples/declarative/modelviews/stringlistmodel/main.cpp index abbffa7..abbffa7 100644 --- a/examples/declarative/stringlistmodel/main.cpp +++ b/examples/declarative/modelviews/stringlistmodel/main.cpp diff --git a/examples/declarative/stringlistmodel/stringlistmodel.pro b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro index 23dc481..23dc481 100644 --- a/examples/declarative/stringlistmodel/stringlistmodel.pro +++ b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro diff --git a/examples/declarative/modelviews/stringlistmodel/stringlistmodel.qrc b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.qrc new file mode 100644 index 0000000..17e9301 --- /dev/null +++ b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>view.qml</file> +</qresource> +</RCC> diff --git a/examples/declarative/stringlistmodel/view.qml b/examples/declarative/modelviews/stringlistmodel/view.qml index 41c03d9..41c03d9 100644 --- a/examples/declarative/stringlistmodel/view.qml +++ b/examples/declarative/modelviews/stringlistmodel/view.qml diff --git a/examples/declarative/webview/alerts.html b/examples/declarative/modelviews/webview/alerts.html index 82caddf..82caddf 100644 --- a/examples/declarative/webview/alerts.html +++ b/examples/declarative/modelviews/webview/alerts.html diff --git a/examples/declarative/webview/alerts.qml b/examples/declarative/modelviews/webview/alerts.qml index 6a5a0d2..7684c3e 100644 --- a/examples/declarative/webview/alerts.qml +++ b/examples/declarative/modelviews/webview/alerts.qml @@ -52,7 +52,7 @@ WebView { font.pixelSize: 20 width: webView.width*0.75 wrapMode: Text.WordWrap - horizontalAlignment: "AlignHCenter" + horizontalAlignment: Text.AlignHCenter } } } diff --git a/examples/declarative/webview/autosize.qml b/examples/declarative/modelviews/webview/autosize.qml index 9632883..9632883 100644 --- a/examples/declarative/webview/autosize.qml +++ b/examples/declarative/modelviews/webview/autosize.qml diff --git a/examples/declarative/webview/content/FieldText.qml b/examples/declarative/modelviews/webview/content/FieldText.qml index d1d003f..d1d003f 100644 --- a/examples/declarative/webview/content/FieldText.qml +++ b/examples/declarative/modelviews/webview/content/FieldText.qml diff --git a/examples/declarative/webview/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/content/Mapping/Map.qml index 5d3ba81..5d3ba81 100644 --- a/examples/declarative/webview/content/Mapping/Map.qml +++ b/examples/declarative/modelviews/webview/content/Mapping/Map.qml diff --git a/examples/declarative/webview/content/Mapping/map.html b/examples/declarative/modelviews/webview/content/Mapping/map.html index a8726fd..a8726fd 100755 --- a/examples/declarative/webview/content/Mapping/map.html +++ b/examples/declarative/modelviews/webview/content/Mapping/map.html diff --git a/examples/declarative/webview/content/SpinSquare.qml b/examples/declarative/modelviews/webview/content/SpinSquare.qml index dba48d4..dba48d4 100644 --- a/examples/declarative/webview/content/SpinSquare.qml +++ b/examples/declarative/modelviews/webview/content/SpinSquare.qml diff --git a/examples/declarative/webview/content/pics/cancel.png b/examples/declarative/modelviews/webview/content/pics/cancel.png Binary files differindex ecc9533..ecc9533 100644 --- a/examples/declarative/webview/content/pics/cancel.png +++ b/examples/declarative/modelviews/webview/content/pics/cancel.png diff --git a/examples/declarative/webview/content/pics/ok.png b/examples/declarative/modelviews/webview/content/pics/ok.png Binary files differindex 5795f04..5795f04 100644 --- a/examples/declarative/webview/content/pics/ok.png +++ b/examples/declarative/modelviews/webview/content/pics/ok.png diff --git a/examples/declarative/webview/googleMaps.qml b/examples/declarative/modelviews/webview/googleMaps.qml index 5506012..5506012 100644 --- a/examples/declarative/webview/googleMaps.qml +++ b/examples/declarative/modelviews/webview/googleMaps.qml diff --git a/examples/declarative/webview/inline-html.qml b/examples/declarative/modelviews/webview/inline-html.qml index eec7fc6..eec7fc6 100644 --- a/examples/declarative/webview/inline-html.qml +++ b/examples/declarative/modelviews/webview/inline-html.qml diff --git a/examples/declarative/webview/newwindows.html b/examples/declarative/modelviews/webview/newwindows.html index f169599..f169599 100644 --- a/examples/declarative/webview/newwindows.html +++ b/examples/declarative/modelviews/webview/newwindows.html diff --git a/examples/declarative/webview/newwindows.qml b/examples/declarative/modelviews/webview/newwindows.qml index 2e4a72e..2e4a72e 100644 --- a/examples/declarative/webview/newwindows.qml +++ b/examples/declarative/modelviews/webview/newwindows.qml diff --git a/examples/declarative/webview/transparent.qml b/examples/declarative/modelviews/webview/transparent.qml index e4efc31..e4efc31 100644 --- a/examples/declarative/webview/transparent.qml +++ b/examples/declarative/modelviews/webview/transparent.qml diff --git a/examples/declarative/progressbar/progressbar.qmlproject b/examples/declarative/modelviews/webview/webview.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/progressbar/progressbar.qmlproject +++ b/examples/declarative/modelviews/webview/webview.qmlproject diff --git a/examples/declarative/positioners/Button.qml b/examples/declarative/positioners/Button.qml new file mode 100644 index 0000000..d03eeb5 --- /dev/null +++ b/examples/declarative/positioners/Button.qml @@ -0,0 +1,38 @@ +import Qt 4.7 + +Rectangle { + id: page + + property string text + property string icon + signal clicked + + border.color: "black"; color: "steelblue"; radius: 5 + width: pix.width + textelement.width + 13 + height: pix.height + 10 + + Image { id: pix; x: 5; y:5; source: parent.icon } + + Text { + id: textelement + text: page.text; color: "white" + x: pix.width + pix.x + 3 + anchors.verticalCenter: pix.verticalCenter + } + + MouseArea { + id: mr + anchors.fill: parent + onClicked: { parent.focus = true; page.clicked() } + } + + states: State { + name: "pressed"; when: mr.pressed + PropertyChanges { target: textelement; x: 5 } + PropertyChanges { target: pix; x: textelement.x + textelement.width + 3 } + } + + transitions: Transition { + NumberAnimation { properties: "x,left"; easing.type: Easing.InOutQuad; duration: 200 } + } +} diff --git a/examples/declarative/layouts/add.png b/examples/declarative/positioners/add.png Binary files differindex f29d84b..f29d84b 100644 --- a/examples/declarative/layouts/add.png +++ b/examples/declarative/positioners/add.png diff --git a/examples/declarative/layouts/del.png b/examples/declarative/positioners/del.png Binary files differindex 1d753a3..1d753a3 100644 --- a/examples/declarative/layouts/del.png +++ b/examples/declarative/positioners/del.png diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/positioners/positioners.qml index 3703b59..2cb0b8b 100644 --- a/examples/declarative/layouts/positioners.qml +++ b/examples/declarative/positioners/positioners.qml @@ -8,10 +8,10 @@ Rectangle { id: layout1 y: 0 move: Transition { - NumberAnimation { properties: "y"; easing.type: "OutBounce" } + NumberAnimation { properties: "y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "y"; easing.type: "OutQuad" } + NumberAnimation { properties: "y"; easing.type: Easing.OutQuad } } Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 } @@ -43,10 +43,10 @@ Rectangle { id: layout2 y: 300 move: Transition { - NumberAnimation { properties: "x"; easing.type: "OutBounce" } + NumberAnimation { properties: "x"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x"; easing.type: "OutQuad" } + NumberAnimation { properties: "x"; easing.type: Easing.OutQuad } } Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 } @@ -117,11 +117,11 @@ Rectangle { columns: 3 move: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } @@ -167,11 +167,11 @@ Rectangle { x: 260; y: 250; width: 150 move: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } diff --git a/examples/declarative/positioners/positioners.qmlproject b/examples/declarative/positioners/positioners.qmlproject new file mode 100644 index 0000000..e526217 --- /dev/null +++ b/examples/declarative/positioners/positioners.qmlproject @@ -0,0 +1,18 @@ +/* File generated by QtCreator */ + +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/positioners/positioners.qmlproject.user b/examples/declarative/positioners/positioners.qmlproject.user new file mode 100644 index 0000000..593479d --- /dev/null +++ b/examples/declarative/positioners/positioners.qmlproject.user @@ -0,0 +1,41 @@ +<!DOCTYPE QtCreatorProject> +<qtcreator> + <data> + <variable>ProjectExplorer.Project.ActiveTarget</variable> + <value type="int">0</value> + </data> + <data> + <variable>ProjectExplorer.Project.EditorSettings</variable> + <valuemap type="QVariantMap"> + <value key="EditorConfiguration.Codec" type="QByteArray">UTF-8</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.Target.0</variable> + <valuemap type="QVariantMap"> + <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Runtime</value> + <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlTarget</value> + <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">-1</value> + <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value> + <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">0</value> + <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap"> + <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Runtime</value> + <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlRunConfiguration</value> + <value key="QmlProjectManager.QmlRunConfiguration.DebugServerAddress" type="QString">127.0.0.1</value> + <value key="QmlProjectManager.QmlRunConfiguration.DebugServerPort" type="int">3768</value> + <value key="QmlProjectManager.QmlRunConfiguration.MainScript" type="QString">positioners.qml</value> + <value key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewer" type="QString"></value> + <value key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments" type="QString"></value> + </valuemap> + <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.TargetCount</variable> + <value type="int">1</value> + </data> + <data> + <variable>ProjectExplorer.Project.Updater.FileVersion</variable> + <value type="int">4</value> + </data> +</qtcreator> diff --git a/examples/declarative/scrollbar/ScrollBar.qml b/examples/declarative/scrollbar/ScrollBar.qml deleted file mode 100644 index 5433156..0000000 --- a/examples/declarative/scrollbar/ScrollBar.qml +++ /dev/null @@ -1,33 +0,0 @@ -import Qt 4.7 - -Item { - id: scrollBar - - // The properties that define the scrollbar's state. - // position and pageSize are in the range 0.0 - 1.0. They are relative to the - // height of the page, i.e. a pageSize of 0.5 means that you can see 50% - // of the height of the view. - // orientation can be either 'Vertical' or 'Horizontal' - property real position - property real pageSize - property variant orientation : "Vertical" - - // A light, semi-transparent background - Rectangle { - id: background - anchors.fill: parent - radius: orientation == 'Vertical' ? (width/2 - 1) : (height/2 - 1) - color: "white" - opacity: 0.3 - } - // Size the bar to the required size, depending upon the orientation. - Rectangle { - x: orientation == 'Vertical' ? 1 : (scrollBar.position * (scrollBar.width-2) + 1) - y: orientation == 'Vertical' ? (scrollBar.position * (scrollBar.height-2) + 1) : 1 - width: orientation == 'Vertical' ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2)) - height: orientation == 'Vertical' ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2) - radius: orientation == 'Vertical' ? (width/2 - 1) : (height/2 - 1) - color: "black" - opacity: 0.7 - } -} diff --git a/examples/declarative/sql/hello.qml b/examples/declarative/sqllocalstorage/hello.qml index 8b021b7..8b021b7 100644 --- a/examples/declarative/sql/hello.qml +++ b/examples/declarative/sqllocalstorage/hello.qml diff --git a/examples/declarative/mousearea/mousearea.qmlproject b/examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/mousearea/mousearea.qmlproject +++ b/examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject diff --git a/examples/declarative/text/fonts/availableFonts.qml b/examples/declarative/text/fonts/availableFonts.qml new file mode 100644 index 0000000..defa4ce --- /dev/null +++ b/examples/declarative/text/fonts/availableFonts.qml @@ -0,0 +1,17 @@ +import Qt 4.7 + +Rectangle { + width: 480; height: 640; color: "steelblue" + + ListView { + anchors.fill: parent; model: Qt.fontFamilies() + + delegate: Item { + height: 40; width: ListView.view.width + Text { + anchors.centerIn: parent + text: modelData; font.family: modelData; font.pixelSize: 24; color: "white" + } + } + } +} diff --git a/examples/declarative/fonts/banner.qml b/examples/declarative/text/fonts/banner.qml index 353354a..353354a 100644 --- a/examples/declarative/fonts/banner.qml +++ b/examples/declarative/text/fonts/banner.qml diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/text/fonts/fonts.qml index ae31b03..f3eac48 100644 --- a/examples/declarative/fonts/fonts.qml +++ b/examples/declarative/text/fonts/fonts.qml @@ -51,9 +51,9 @@ Rectangle { } Text { text: { - if (webFont.status == 1) myText - else if (webFont.status == 2) "Loading..." - else if (webFont.status == 3) "Error loading font" + if (webFont.status == FontLoader.Ready) myText + else if (webFont.status == FontLoader.Loading) "Loading..." + else if (webFont.status == FontLoader.Error) "Error loading font" } color: "lightsteelblue" width: parent.width diff --git a/examples/declarative/fonts/fonts.qmlproject b/examples/declarative/text/fonts/fonts.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/fonts/fonts.qmlproject +++ b/examples/declarative/text/fonts/fonts.qmlproject diff --git a/examples/declarative/fonts/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf Binary files differindex cf93f96..cf93f96 100644 --- a/examples/declarative/fonts/fonts/tarzeau_ocr_a.ttf +++ b/examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf diff --git a/examples/declarative/fonts/hello.qml b/examples/declarative/text/fonts/hello.qml index d4d0e4c..0d6f4cd 100644 --- a/examples/declarative/fonts/hello.qml +++ b/examples/declarative/text/fonts/hello.qml @@ -19,7 +19,7 @@ Rectangle { SequentialAnimation on font.letterSpacing { loops: Animation.Infinite; - NumberAnimation { from: 100; to: 300; easing.type: "InQuad"; duration: 3000 } + NumberAnimation { from: 100; to: 300; easing.type: Easing.InQuad; duration: 3000 } ScriptAction { script: { container.y = (screen.height / 4) + (Math.random() * screen.height / 2) diff --git a/examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject b/examples/declarative/text/text.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject +++ b/examples/declarative/text/text.qmlproject diff --git a/examples/declarative/listmodel-threaded/dataloader.js b/examples/declarative/threading/threadedlistmodel/dataloader.js index d720f09..d720f09 100644 --- a/examples/declarative/listmodel-threaded/dataloader.js +++ b/examples/declarative/threading/threadedlistmodel/dataloader.js diff --git a/examples/declarative/layouts/layouts.qmlproject b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/layouts/layouts.qmlproject +++ b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject diff --git a/examples/declarative/listmodel-threaded/timedisplay.qml b/examples/declarative/threading/threadedlistmodel/timedisplay.qml index bad7010..bad7010 100644 --- a/examples/declarative/listmodel-threaded/timedisplay.qml +++ b/examples/declarative/threading/threadedlistmodel/timedisplay.qml diff --git a/examples/declarative/images/images.qmlproject b/examples/declarative/threading/threading.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/images/images.qmlproject +++ b/examples/declarative/threading/threading.qmlproject diff --git a/examples/declarative/workerscript/workerscript.js b/examples/declarative/threading/workerscript/workerscript.js index f76471f..f76471f 100644 --- a/examples/declarative/workerscript/workerscript.js +++ b/examples/declarative/threading/workerscript/workerscript.js diff --git a/examples/declarative/workerscript/workerscript.qml b/examples/declarative/threading/workerscript/workerscript.qml index 2294a81..2294a81 100644 --- a/examples/declarative/workerscript/workerscript.qml +++ b/examples/declarative/threading/workerscript/workerscript.qml diff --git a/examples/declarative/gestures/gestures.qmlproject b/examples/declarative/threading/workerscript/workerscript.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/gestures/gestures.qmlproject +++ b/examples/declarative/threading/workerscript/workerscript.qmlproject diff --git a/examples/declarative/gestures/experimental-gestures.qml b/examples/declarative/touchinteraction/gestures/experimental-gestures.qml index cb190ea..cb190ea 100644 --- a/examples/declarative/gestures/experimental-gestures.qml +++ b/examples/declarative/touchinteraction/gestures/experimental-gestures.qml diff --git a/examples/declarative/flipable/flipable.qmlproject b/examples/declarative/touchinteraction/gestures/gestures.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/flipable/flipable.qmlproject +++ b/examples/declarative/touchinteraction/gestures/gestures.qmlproject diff --git a/examples/declarative/mousearea/mouse.qml b/examples/declarative/touchinteraction/mousearea/mouse.qml index 67302a8..06134b7 100644 --- a/examples/declarative/mousearea/mouse.qml +++ b/examples/declarative/touchinteraction/mousearea/mouse.qml @@ -33,7 +33,7 @@ Rectangle { MouseArea { anchors.fill: parent drag.target: parent - drag.axis: "XAxis" + drag.axis: Drag.XAxis drag.minimumX: 0 drag.maximumX: 150 diff --git a/examples/declarative/fillmode/fillmode.qmlproject b/examples/declarative/touchinteraction/mousearea/mousearea.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/fillmode/fillmode.qmlproject +++ b/examples/declarative/touchinteraction/mousearea/mousearea.qmlproject diff --git a/examples/declarative/extending/extending.qmlproject b/examples/declarative/touchinteraction/touchinteraction.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/extending/extending.qmlproject +++ b/examples/declarative/touchinteraction/touchinteraction.qmlproject diff --git a/examples/declarative/clocks/clocks.qml b/examples/declarative/toys/clocks/clocks.qml index 22cf820..22cf820 100644 --- a/examples/declarative/clocks/clocks.qml +++ b/examples/declarative/toys/clocks/clocks.qml diff --git a/examples/declarative/clocks/clocks.qmlproject b/examples/declarative/toys/clocks/clocks.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/clocks/clocks.qmlproject +++ b/examples/declarative/toys/clocks/clocks.qmlproject diff --git a/examples/declarative/clocks/content/Clock.qml b/examples/declarative/toys/clocks/content/Clock.qml index 3426e6a..3426e6a 100644 --- a/examples/declarative/clocks/content/Clock.qml +++ b/examples/declarative/toys/clocks/content/Clock.qml diff --git a/examples/declarative/clocks/content/background.png b/examples/declarative/toys/clocks/content/background.png Binary files differindex a885950..a885950 100644 --- a/examples/declarative/clocks/content/background.png +++ b/examples/declarative/toys/clocks/content/background.png diff --git a/examples/declarative/clocks/content/center.png b/examples/declarative/toys/clocks/content/center.png Binary files differindex 7fbd802..7fbd802 100755 --- a/examples/declarative/clocks/content/center.png +++ b/examples/declarative/toys/clocks/content/center.png diff --git a/examples/declarative/clocks/content/clock-night.png b/examples/declarative/toys/clocks/content/clock-night.png Binary files differindex cc7151a..cc7151a 100755 --- a/examples/declarative/clocks/content/clock-night.png +++ b/examples/declarative/toys/clocks/content/clock-night.png diff --git a/examples/declarative/clocks/content/clock.png b/examples/declarative/toys/clocks/content/clock.png Binary files differindex 462edac..462edac 100755 --- a/examples/declarative/clocks/content/clock.png +++ b/examples/declarative/toys/clocks/content/clock.png diff --git a/examples/declarative/clocks/content/hour.png b/examples/declarative/toys/clocks/content/hour.png Binary files differindex f8061a1..f8061a1 100755 --- a/examples/declarative/clocks/content/hour.png +++ b/examples/declarative/toys/clocks/content/hour.png diff --git a/examples/declarative/clocks/content/minute.png b/examples/declarative/toys/clocks/content/minute.png Binary files differindex 1297ec7..1297ec7 100755 --- a/examples/declarative/clocks/content/minute.png +++ b/examples/declarative/toys/clocks/content/minute.png diff --git a/examples/declarative/clocks/content/second.png b/examples/declarative/toys/clocks/content/second.png Binary files differindex 4aa9fb5..4aa9fb5 100755 --- a/examples/declarative/clocks/content/second.png +++ b/examples/declarative/toys/clocks/content/second.png diff --git a/examples/declarative/dial/content/Dial.qml b/examples/declarative/toys/dial/content/Dial.qml index f9ab3e3..6f24801 100644 --- a/examples/declarative/dial/content/Dial.qml +++ b/examples/declarative/toys/dial/content/Dial.qml @@ -8,6 +8,7 @@ Item { Image { source: "background.png" } +//! [needle_shadow] Image { x: 93 y: 35 @@ -17,6 +18,8 @@ Item { angle: needleRotation.angle } } +//! [needle_shadow] +//! [needle] Image { id: needle x: 95; y: 33 @@ -33,5 +36,8 @@ Item { } } } +//! [needle] +//! [overlay] Image { x: 21; y: 18; source: "overlay.png" } +//! [overlay] } diff --git a/examples/declarative/dial/content/background.png b/examples/declarative/toys/dial/content/background.png Binary files differindex 75d555d..75d555d 100644 --- a/examples/declarative/dial/content/background.png +++ b/examples/declarative/toys/dial/content/background.png diff --git a/examples/declarative/dial/content/needle.png b/examples/declarative/toys/dial/content/needle.png Binary files differindex 2d19f75..2d19f75 100644 --- a/examples/declarative/dial/content/needle.png +++ b/examples/declarative/toys/dial/content/needle.png diff --git a/examples/declarative/dial/content/needle_shadow.png b/examples/declarative/toys/dial/content/needle_shadow.png Binary files differindex 8d8a928..8d8a928 100644 --- a/examples/declarative/dial/content/needle_shadow.png +++ b/examples/declarative/toys/dial/content/needle_shadow.png diff --git a/examples/declarative/dial/content/overlay.png b/examples/declarative/toys/dial/content/overlay.png Binary files differindex 3860a7b..3860a7b 100644 --- a/examples/declarative/dial/content/overlay.png +++ b/examples/declarative/toys/dial/content/overlay.png diff --git a/examples/declarative/dial/dial-example.qml b/examples/declarative/toys/dial/dial-example.qml index fd899a5..900954f 100644 --- a/examples/declarative/dial/dial-example.qml +++ b/examples/declarative/toys/dial/dial-example.qml @@ -1,6 +1,7 @@ import Qt 4.7 import "content" +//! [0] Rectangle { color: "#545454" width: 300; height: 300 @@ -14,7 +15,10 @@ Rectangle { Rectangle { id: container - anchors { bottom: parent.bottom; left: parent.left; right: parent.right; leftMargin: 20; rightMargin: 20; bottomMargin: 10 } + anchors { bottom: parent.bottom; left: parent.left + right: parent.right; leftMargin: 20; rightMargin: 20 + bottomMargin: 10 + } height: 16 radius: 8 @@ -37,8 +41,10 @@ Rectangle { MouseArea { anchors.fill: parent - drag.target: parent; drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: container.width - 32 + drag.target: parent; drag.axis: Drag.XAxis + drag.minimumX: 2; drag.maximumX: container.width - 32 } } } } +//! [0]
\ No newline at end of file diff --git a/examples/declarative/dial/dial.qmlproject b/examples/declarative/toys/dial/dial.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/dial/dial.qmlproject +++ b/examples/declarative/toys/dial/dial.qmlproject diff --git a/examples/declarative/toys/dynamic/dynamic.qml b/examples/declarative/toys/dynamic/dynamic.qml new file mode 100644 index 0000000..52c7c1e --- /dev/null +++ b/examples/declarative/toys/dynamic/dynamic.qml @@ -0,0 +1,176 @@ +import Qt 4.7 +import Qt.labs.particles 1.0 +import "qml" + +Item { + id: window + + property int activeSuns: 0 + + //This is a desktop-sized example + width: 1024; height: 512 + + //This is the message box that pops up when there's an error + Rectangle { + id: dialog + + opacity: 0 + anchors.centerIn: parent + width: dialogText.width + 6; height: dialogText.height + 6 + border.color: 'black' + color: 'lightsteelblue' + z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones. + + function show(str){ + dialogText.text = str; + dialogAnim.start(); + } + + Text { + id: dialogText + x: 3; y: 3 + font.pixelSize: 14 + } + + SequentialAnimation { + id: dialogAnim + NumberAnimation { target: dialog; property:"opacity"; to: 1; duration: 1000 } + PauseAnimation { duration: 5000 } + NumberAnimation { target: dialog; property:"opacity"; to: 0; duration: 1000 } + } + } + + // sky + Rectangle { + id: sky + anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter } + gradient: Gradient { + GradientStop { id: gradientStopA; position: 0.0; color: "#0E1533" } + GradientStop { id: gradientStopB; position: 1.0; color: "#437284" } + } + } + + // stars (when there's no sun) + Particles { + id: stars + x: 0; y: 0; width: parent.width; height: parent.height / 2 + source: "images/star.png" + angleDeviation: 360 + velocity: 0; velocityDeviation: 0 + count: parent.width / 10 + fadeInDuration: 2800 + opacity: 1 + } + + // ground + Rectangle { + id: ground + z: 2 // just above the sun so that the sun can set behind it + anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.left; bottom: parent.bottom } + gradient: Gradient { + GradientStop { position: 0.0; color: "ForestGreen" } + GradientStop { position: 1.0; color: "DarkGreen" } + } + } + + SystemPalette { id: activePalette } + + // right-hand panel + Rectangle { + id: toolbox + + width: 480 + color: activePalette.window + anchors { right: parent.right; top: parent.top; bottom: parent.bottom } + + Column { + anchors.centerIn: parent + spacing: 8 + + Text { text: "Drag an item into the scene." } + + Rectangle { + width: childrenRect.width + 10; height: childrenRect.height + 10 + border.color: "black" + + Row { + anchors.centerIn: parent + spacing: 8 + + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "Sun.qml" + image: "../images/sun.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "GenericSceneItem.qml" + image: "../images/moon.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/tree_s.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/rabbit_brown.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/rabbit_bw.png" + } + } + } + + Text { text: "Active Suns: " + activeSuns } + + Rectangle { width: parent.width; height: 1; color: "black" } + + Text { text: "Arbitrary QML:" } + + Rectangle { + width: 460; height: 240 + + TextEdit { + id: qmlText + anchors.fill: parent; anchors.margins: 5 + readOnly: false + focusOnPress: true + font.pixelSize: 14 + + text: "import Qt 4.7\nImage {\n id: smile\n x: 500 * Math.random()\n y: 200 * Math.random() \n source: 'images/face-smile.png'\n\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n\n Component.onCompleted: smile.destroy(1500);\n}" + } + } + + Button { + text: "Create" + onClicked: { + try { + Qt.createQmlObject(qmlText.text, window, 'CustomObject'); + } catch(err) { + dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message); + } + } + } + } + } + + //Day state, for when a sun is added to the scene + states: State { + name: "Day" + when: window.activeSuns > 0 + + PropertyChanges { target: gradientStopA; color: "DeepSkyBlue" } + PropertyChanges { target: gradientStopB; color: "SkyBlue" } + PropertyChanges { target: stars; opacity: 0 } + } + + transitions: Transition { + PropertyAnimation { duration: 3000 } + ColorAnimation { duration: 3000 } + } + +} diff --git a/examples/declarative/dynamic/dynamic.qmlproject b/examples/declarative/toys/dynamic/dynamic.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/dynamic/dynamic.qmlproject +++ b/examples/declarative/toys/dynamic/dynamic.qmlproject diff --git a/examples/declarative/dynamic/images/NOTE b/examples/declarative/toys/dynamic/images/NOTE index fcd87f9..fcd87f9 100644 --- a/examples/declarative/dynamic/images/NOTE +++ b/examples/declarative/toys/dynamic/images/NOTE diff --git a/examples/declarative/animations/images/face-smile.png b/examples/declarative/toys/dynamic/images/face-smile.png Binary files differindex 3d66d72..3d66d72 100644 --- a/examples/declarative/animations/images/face-smile.png +++ b/examples/declarative/toys/dynamic/images/face-smile.png diff --git a/examples/declarative/dynamic/images/moon.png b/examples/declarative/toys/dynamic/images/moon.png Binary files differindex 1c0d606..1c0d606 100644 --- a/examples/declarative/dynamic/images/moon.png +++ b/examples/declarative/toys/dynamic/images/moon.png diff --git a/examples/declarative/dynamic/images/rabbit_brown.png b/examples/declarative/toys/dynamic/images/rabbit_brown.png Binary files differindex ebfdeed..ebfdeed 100644 --- a/examples/declarative/dynamic/images/rabbit_brown.png +++ b/examples/declarative/toys/dynamic/images/rabbit_brown.png diff --git a/examples/declarative/dynamic/images/rabbit_bw.png b/examples/declarative/toys/dynamic/images/rabbit_bw.png Binary files differindex 7bff9b9..7bff9b9 100644 --- a/examples/declarative/dynamic/images/rabbit_bw.png +++ b/examples/declarative/toys/dynamic/images/rabbit_bw.png diff --git a/examples/declarative/animations/images/star.png b/examples/declarative/toys/dynamic/images/star.png Binary files differindex 27ef924..27ef924 100644 --- a/examples/declarative/animations/images/star.png +++ b/examples/declarative/toys/dynamic/images/star.png diff --git a/examples/declarative/animations/images/sun.png b/examples/declarative/toys/dynamic/images/sun.png Binary files differindex 7713ca5..7713ca5 100644 --- a/examples/declarative/animations/images/sun.png +++ b/examples/declarative/toys/dynamic/images/sun.png diff --git a/examples/declarative/dynamic/images/tree_s.png b/examples/declarative/toys/dynamic/images/tree_s.png Binary files differindex 6eac35a..6eac35a 100644 --- a/examples/declarative/dynamic/images/tree_s.png +++ b/examples/declarative/toys/dynamic/images/tree_s.png diff --git a/examples/declarative/toys/dynamic/qml/Button.qml b/examples/declarative/toys/dynamic/qml/Button.qml new file mode 100644 index 0000000..963a850 --- /dev/null +++ b/examples/declarative/toys/dynamic/qml/Button.qml @@ -0,0 +1,40 @@ +import Qt 4.7 + +Rectangle { + id: container + + property variant text + signal clicked + + height: text.height + 10; width: text.width + 20 + border.width: 1 + radius: 4 + smooth: true + + gradient: Gradient { + GradientStop { + position: 0.0 + color: !mouseArea.pressed ? activePalette.light : activePalette.button + } + GradientStop { + position: 1.0 + color: !mouseArea.pressed ? activePalette.button : activePalette.dark + } + } + + SystemPalette { id: activePalette } + + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked() + } + + Text { + id: text + anchors.centerIn:parent + font.pointSize: 10 + text: parent.text + color: activePalette.buttonText + } +} diff --git a/examples/declarative/toys/dynamic/qml/PaletteItem.qml b/examples/declarative/toys/dynamic/qml/PaletteItem.qml new file mode 100644 index 0000000..dcb5cc3 --- /dev/null +++ b/examples/declarative/toys/dynamic/qml/PaletteItem.qml @@ -0,0 +1,19 @@ +import Qt 4.7 +import "itemCreation.js" as Code + +Image { + id: paletteItem + + property string componentFile + property string image + + source: image + + MouseArea { + anchors.fill: parent + + onPressed: Code.startDrag(mouse); + onPositionChanged: Code.continueDrag(mouse); + onReleased: Code.endDrag(mouse); + } +} diff --git a/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml b/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml new file mode 100644 index 0000000..c04d3dc --- /dev/null +++ b/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml @@ -0,0 +1,25 @@ +import Qt 4.7 + +Image { + id: rootItem + + property bool created: false + property string image + + property double scaledBottom: y + (height + height*scale) / 2 + property bool onLand: scaledBottom > window.height / 2 + + source: image + opacity: onLand ? 1 : 0.25 + scale: Math.max((y + height - 250) * 0.01, 0.3) + smooth: true + + onCreatedChanged: { + if (created && !onLand) + rootItem.destroy(); + else + z = scaledBottom; + } + + onYChanged: z = scaledBottom; +} diff --git a/examples/declarative/toys/dynamic/qml/Sun.qml b/examples/declarative/toys/dynamic/qml/Sun.qml new file mode 100644 index 0000000..43dcb9a --- /dev/null +++ b/examples/declarative/toys/dynamic/qml/Sun.qml @@ -0,0 +1,38 @@ +import Qt 4.7 + +Image { + id: sun + + property bool created: false + property string image: "../images/sun.png" + + source: image + + // once item is created, start moving offscreen + NumberAnimation on y { + to: window.height / 2 + running: created + onRunningChanged: { + if (running) + duration = (window.height - sun.y) * 10; + else + state = "OffScreen" + } + } + + states: State { + name: "OffScreen" + StateChangeScript { + script: { sun.created = false; sun.destroy() } + } + } + + onCreatedChanged: { + if (created) { + sun.z = 1; // above the sky but below the ground layer + window.activeSuns++; + } else { + window.activeSuns--; + } + } +} diff --git a/examples/declarative/toys/dynamic/qml/itemCreation.js b/examples/declarative/toys/dynamic/qml/itemCreation.js new file mode 100644 index 0000000..59750f3 --- /dev/null +++ b/examples/declarative/toys/dynamic/qml/itemCreation.js @@ -0,0 +1,65 @@ +var itemComponent = null; +var draggedItem = null; +var startingMouse; +var posnInWindow; + +function startDrag(mouse) +{ + posnInWindow = paletteItem.mapToItem(null, 0, 0); + startingMouse = { x: mouse.x, y: mouse.y } + loadComponent(); +} + +//Creation is split into two functions due to an asynchronous wait while +//possible external files are loaded. + +function loadComponent() { + if (itemComponent != null) { // component has been previously loaded + createItem(); + return; + } + + itemComponent = Qt.createComponent(paletteItem.componentFile); + if (itemComponent.status == Component.Loading) //Depending on the content, it can be ready or error immediately + component.statusChanged.connect(createItem); + else + createItem(); +} + +function createItem() { + if (itemComponent.status == Component.Ready && draggedItem == null) { + draggedItem = itemComponent.createObject(window); + draggedItem.image = paletteItem.image; + draggedItem.x = posnInWindow.x; + draggedItem.y = posnInWindow.y; + draggedItem.z = 3; // make sure created item is above the ground layer + } else if (itemComponent.status == Component.Error) { + draggedItem = null; + console.log("error creating component"); + console.log(component.errorsString()); + } +} + +function continueDrag(mouse) +{ + if (draggedItem == null) + return; + + draggedItem.x = mouse.x + posnInWindow.x - startingMouse.x; + draggedItem.y = mouse.y + posnInWindow.y - startingMouse.y; +} + +function endDrag(mouse) +{ + if (draggedItem == null) + return; + + if (draggedItem.x + draggedItem.width > toolbox.x) { //Don't drop it in the toolbox + draggedItem.destroy(); + draggedItem = null; + } else { + draggedItem.created = true; + draggedItem = null; + } +} + diff --git a/examples/declarative/tic-tac-toe/content/Button.qml b/examples/declarative/toys/tic-tac-toe/content/Button.qml index ecf18cd..ecf18cd 100644 --- a/examples/declarative/tic-tac-toe/content/Button.qml +++ b/examples/declarative/toys/tic-tac-toe/content/Button.qml diff --git a/examples/declarative/tic-tac-toe/content/TicTac.qml b/examples/declarative/toys/tic-tac-toe/content/TicTac.qml index d247943..d247943 100644 --- a/examples/declarative/tic-tac-toe/content/TicTac.qml +++ b/examples/declarative/toys/tic-tac-toe/content/TicTac.qml diff --git a/examples/declarative/tic-tac-toe/content/pics/board.png b/examples/declarative/toys/tic-tac-toe/content/pics/board.png Binary files differindex 7e5b7ba..7e5b7ba 100644 --- a/examples/declarative/tic-tac-toe/content/pics/board.png +++ b/examples/declarative/toys/tic-tac-toe/content/pics/board.png diff --git a/examples/declarative/tic-tac-toe/content/pics/o.png b/examples/declarative/toys/tic-tac-toe/content/pics/o.png Binary files differindex abc7ee0..abc7ee0 100644 --- a/examples/declarative/tic-tac-toe/content/pics/o.png +++ b/examples/declarative/toys/tic-tac-toe/content/pics/o.png diff --git a/examples/declarative/tic-tac-toe/content/pics/x.png b/examples/declarative/toys/tic-tac-toe/content/pics/x.png Binary files differindex ddc65c8..ddc65c8 100644 --- a/examples/declarative/tic-tac-toe/content/pics/x.png +++ b/examples/declarative/toys/tic-tac-toe/content/pics/x.png diff --git a/examples/declarative/tic-tac-toe/content/tic-tac-toe.js b/examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js index f8d6d9f..f8d6d9f 100644 --- a/examples/declarative/tic-tac-toe/content/tic-tac-toe.js +++ b/examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js diff --git a/examples/declarative/tic-tac-toe/tic-tac-toe.qml b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml index dd13052..dd13052 100644 --- a/examples/declarative/tic-tac-toe/tic-tac-toe.qml +++ b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml diff --git a/examples/declarative/connections/connections.qmlproject b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/connections/connections.qmlproject +++ b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject diff --git a/examples/declarative/border-image/border-image.qmlproject b/examples/declarative/toys/toys.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/border-image/border-image.qmlproject +++ b/examples/declarative/toys/toys.qmlproject diff --git a/examples/declarative/tvtennis/tvtennis.qml b/examples/declarative/toys/tvtennis/tvtennis.qml index 354a16f..c90d9c5 100644 --- a/examples/declarative/tvtennis/tvtennis.qml +++ b/examples/declarative/toys/tvtennis/tvtennis.qml @@ -1,5 +1,4 @@ import Qt 4.7 -import Qt.multimedia 4.7 Rectangle { id: page @@ -17,17 +16,12 @@ Rectangle { x: 20; width: 20; height: 20; z: 1 color: "Lime" - SoundEffect { id: paddle; source: "paddle.wav" } - SoundEffect { id: wall; source: "click.wav" } - // Move the ball to the right and back to the left repeatedly SequentialAnimation on x { loops: Animation.Infinite NumberAnimation { to: page.width - 40; duration: 2000 } - ScriptAction { script: paddle.play() } PropertyAction { target: ball; property: "direction"; value: "left" } NumberAnimation { to: 20; duration: 2000 } - ScriptAction { script: paddle.play() } PropertyAction { target: ball; property: "direction"; value: "right" } } @@ -37,10 +31,8 @@ Rectangle { // Detect the ball hitting the top or bottom of the view and bounce it onYChanged: { if (y <= 0) { - wall.play(); targetY = page.height - 20; } else if (y >= page.height - 20) { - wall.play(); targetY = 0; } } diff --git a/examples/declarative/aspectratio/aspectratio.qmlproject b/examples/declarative/toys/tvtennis/tvtennis.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/aspectratio/aspectratio.qmlproject +++ b/examples/declarative/toys/tvtennis/tvtennis.qmlproject diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/toys/velocity/Day.qml index 433295b..350c1c4 100644 --- a/examples/declarative/velocity/Day.qml +++ b/examples/declarative/toys/velocity/Day.qml @@ -61,7 +61,7 @@ Component { id: mouse anchors.fill: parent drag.target: stickyPage - drag.axis: "XandYAxis" + drag.axis: Drag.XandYAxis drag.minimumY: 0 drag.maximumY: page.height - 80 drag.minimumX: 100 diff --git a/examples/declarative/velocity/cork.jpg b/examples/declarative/toys/velocity/cork.jpg Binary files differindex 160bc00..160bc00 100644 --- a/examples/declarative/velocity/cork.jpg +++ b/examples/declarative/toys/velocity/cork.jpg diff --git a/examples/declarative/velocity/note-yellow.png b/examples/declarative/toys/velocity/note-yellow.png Binary files differindex 8ddecc8..8ddecc8 100644 --- a/examples/declarative/velocity/note-yellow.png +++ b/examples/declarative/toys/velocity/note-yellow.png diff --git a/examples/declarative/velocity/tack.png b/examples/declarative/toys/velocity/tack.png Binary files differindex cef2d1c..cef2d1c 100644 --- a/examples/declarative/velocity/tack.png +++ b/examples/declarative/toys/velocity/tack.png diff --git a/examples/declarative/velocity/velocity.qml b/examples/declarative/toys/velocity/velocity.qml index 871bafc..871bafc 100644 --- a/examples/declarative/velocity/velocity.qml +++ b/examples/declarative/toys/velocity/velocity.qml diff --git a/examples/declarative/animations/animations.qmlproject b/examples/declarative/toys/velocity/velocity.qmlproject index d4909f8..d4909f8 100644 --- a/examples/declarative/animations/animations.qmlproject +++ b/examples/declarative/toys/velocity/velocity.qmlproject diff --git a/examples/declarative/tutorials/extending/extending.pro b/examples/declarative/tutorials/extending/extending.pro new file mode 100644 index 0000000..0c86fed --- /dev/null +++ b/examples/declarative/tutorials/extending/extending.pro @@ -0,0 +1,9 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + chapter1-basics \ + chapter2-methods \ + chapter3-bindings \ + chapter4-customPropertyTypes \ + chapter5-plugins + diff --git a/examples/declarative/tutorials/helloworld/tutorial1.qml b/examples/declarative/tutorials/helloworld/tutorial1.qml index 5e27b45..04cd155 100644 --- a/examples/declarative/tutorials/helloworld/tutorial1.qml +++ b/examples/declarative/tutorials/helloworld/tutorial1.qml @@ -14,8 +14,9 @@ Rectangle { Text { id: helloText text: "Hello world!" + y: 30 + anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true - y: 30; anchors.horizontalCenter: page.horizontalCenter } //![2] } diff --git a/examples/declarative/tutorials/helloworld/tutorial2.qml b/examples/declarative/tutorials/helloworld/tutorial2.qml index 085efa4..66be509 100644 --- a/examples/declarative/tutorials/helloworld/tutorial2.qml +++ b/examples/declarative/tutorials/helloworld/tutorial2.qml @@ -9,8 +9,9 @@ Rectangle { Text { id: helloText text: "Hello world!" + y: 30 + anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true - y: 30; anchors.horizontalCenter: page.horizontalCenter } Grid { diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml index 4bf4970..0da762c 100644 --- a/examples/declarative/tutorials/helloworld/tutorial3.qml +++ b/examples/declarative/tutorials/helloworld/tutorial3.qml @@ -9,8 +9,9 @@ Rectangle { Text { id: helloText text: "Hello world!" + y: 30 + anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true - y: 30; anchors.horizontalCenter: page.horizontalCenter //![1] MouseArea { id: mouseArea; anchors.fill: parent } @@ -27,7 +28,7 @@ Rectangle { transitions: Transition { from: ""; to: "down"; reversible: true ParallelAnimation { - NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: Easing.InOutQuad } ColorAnimation { duration: 500 } } } diff --git a/examples/declarative/tutorials/samegame/samegame1/Block.qml b/examples/declarative/tutorials/samegame/samegame1/Block.qml index a23654b..11fd844 100644 --- a/examples/declarative/tutorials/samegame/samegame1/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame1/Block.qml @@ -7,7 +7,7 @@ Item { Image { id: img anchors.fill: parent - source: "../shared/pics/redStone.png"; + source: "../shared/pics/redStone.png" } } //![0] diff --git a/examples/declarative/tutorials/samegame/samegame1/Button.qml b/examples/declarative/tutorials/samegame/samegame1/Button.qml index e84b1ce..96a80eb 100644 --- a/examples/declarative/tutorials/samegame/samegame1/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame1/Button.qml @@ -8,9 +8,9 @@ Rectangle { signal clicked - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true + width: buttonLabel.width + 20; height: buttonLabel.height + 5 border { width: 1; color: Qt.darker(activePalette.button) } + smooth: true radius: 8 // color the button with a gradient @@ -27,8 +27,17 @@ Rectangle { GradientStop { position: 1.0; color: activePalette.button } } - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } - Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText } + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } } //![0] diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml index b6e01fd..f2974be 100644 --- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml @@ -22,21 +22,20 @@ Rectangle { Rectangle { id: toolBar - width: parent.width; height: 32 + width: parent.width; height: 30 color: activePalette.window anchors.bottom: screen.bottom Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: console.log("This doesn't do anything yet...") } Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: Who knows?" - font.bold: true } } } diff --git a/examples/declarative/tutorials/samegame/samegame2/Block.qml b/examples/declarative/tutorials/samegame/samegame2/Block.qml index 4e71e60..39da84e 100644 --- a/examples/declarative/tutorials/samegame/samegame2/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame2/Block.qml @@ -6,6 +6,6 @@ Item { Image { id: img anchors.fill: parent - source: "../shared/pics/redStone.png"; + source: "../shared/pics/redStone.png" } } diff --git a/examples/declarative/tutorials/samegame/samegame2/Button.qml b/examples/declarative/tutorials/samegame/samegame2/Button.qml index 737d886..4ed856b 100644 --- a/examples/declarative/tutorials/samegame/samegame2/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame2/Button.qml @@ -7,9 +7,9 @@ Rectangle { signal clicked - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true + width: buttonLabel.width + 20; height: buttonLabel.height + 5 border { width: 1; color: Qt.darker(activePalette.button) } + smooth: true radius: 8 // color the button with a gradient @@ -26,7 +26,16 @@ Rectangle { GradientStop { position: 1.0; color: activePalette.button } } - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } - Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText } + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } } diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.js b/examples/declarative/tutorials/samegame/samegame2/samegame.js index e5c790d..0dbe6a6 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.js @@ -37,17 +37,16 @@ function createBlock(column, row) { if (component == null) component = Qt.createComponent("Block.qml"); - // Note that if Block.qml was not a local file, component.isReady would be - // false and we should wait for the component's statusChanged() signal to - // know when the file is downloaded and fully loaded before calling createObject(). - if (component.isReady) { - var dynamicObject = component.createObject(); + // Note that if Block.qml was not a local file, component.status would be + // Loading and we should wait for the component's statusChanged() signal to + // know when the file is downloaded and ready before calling createObject(). + if (component.status == Component.Ready) { + var dynamicObject = component.createObject(background); if (dynamicObject == null) { console.log("error creating block"); console.log(component.errorsString()); return false; } - dynamicObject.parent = background; dynamicObject.x = column * blockSize; dynamicObject.y = row * blockSize; dynamicObject.width = blockSize; diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml index a7d1fba..9b4d4d5 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml @@ -30,7 +30,7 @@ Rectangle { //![1] Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: SameGame.startNewGame() } @@ -38,9 +38,8 @@ Rectangle { Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: Who knows?" - font.bold: true } } } diff --git a/examples/declarative/tutorials/samegame/samegame3/Button.qml b/examples/declarative/tutorials/samegame/samegame3/Button.qml index 737d886..4ed856b 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Button.qml @@ -7,9 +7,9 @@ Rectangle { signal clicked - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true + width: buttonLabel.width + 20; height: buttonLabel.height + 5 border { width: 1; color: Qt.darker(activePalette.button) } + smooth: true radius: 8 // color the button with a gradient @@ -26,7 +26,16 @@ Rectangle { GradientStop { position: 1.0; color: activePalette.button } } - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } - Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText } + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } } diff --git a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml index 15b3b2f..3efed2f 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml @@ -2,31 +2,30 @@ import Qt 4.7 Rectangle { - id: page + id: container - signal closed - - function forceClose() { - page.closed(); - page.opacity = 0; + function show(text) { + dialogText.text = text; + container.opacity = 1; } - function show(txt) { - dialogText.text = txt; - page.opacity = 1; + function hide() { + container.opacity = 0; } - width: dialogText.width + 20; height: dialogText.height + 20 - color: "white" - border.width: 1 + width: dialogText.width + 20 + height: dialogText.height + 20 opacity: 0 - Behavior on opacity { - NumberAnimation { duration: 1000 } + Text { + id: dialogText + anchors.centerIn: parent + text: "" } - Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } - - MouseArea { anchors.fill: parent; onClicked: forceClose(); } + MouseArea { + anchors.fill: parent + onClicked: hide(); + } } //![0] diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js index da0f76e..3e97264 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js @@ -17,7 +17,7 @@ function startNewGame() { maxIndex = maxRow * maxColumn; //Close dialogs - dialog.forceClose(); + dialog.hide(); //Initialize Board board = new Array(maxIndex); @@ -34,18 +34,17 @@ function createBlock(column, row) { if (component == null) component = Qt.createComponent("Block.qml"); - // Note that if Block.qml was not a local file, component.isReady would be - // false and we should wait for the component's statusChanged() signal to - // know when the file is downloaded and fully loaded before calling createObject(). - if (component.isReady) { - var dynamicObject = component.createObject(); + // Note that if Block.qml was not a local file, component.status would be + // Loading and we should wait for the component's statusChanged() signal to + // know when the file is downloaded and ready before calling createObject(). + if (component.status == Component.Ready) { + var dynamicObject = component.createObject(gameCanvas); if (dynamicObject == null) { console.log("error creating block"); console.log(component.errorsString()); return false; } dynamicObject.type = Math.floor(Math.random() * 3); - dynamicObject.parent = gameCanvas; dynamicObject.x = column * gameCanvas.blockSize; dynamicObject.y = row * gameCanvas.blockSize; dynamicObject.width = gameCanvas.blockSize; @@ -59,10 +58,9 @@ function createBlock(column, row) { return true; } -var fillFound; -//Set after a floodFill call to the number of blocks found -var floodBoard; -//Set to 1 if the floodFill reaches off that node +var fillFound; //Set after a floodFill call to the number of blocks found +var floodBoard; //Set to 1 if the floodFill reaches off that node + //![1] function handleClick(xPos, yPos) { var column = Math.floor(xPos / gameCanvas.blockSize); diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml index 50f9d5d..ac93eb1 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml @@ -30,7 +30,6 @@ Rectangle { width: parent.width - (parent.width % blockSize) height: parent.height - (parent.height % blockSize) anchors.centerIn: parent - z: 20 MouseArea { anchors.fill: parent @@ -41,26 +40,29 @@ Rectangle { } //![2] - Dialog { id: dialog; anchors.centerIn: parent; z: 21 } + Dialog { + id: dialog + anchors.centerIn: parent + z: 100 + } //![2] Rectangle { id: toolBar - width: parent.width; height: 32 + width: parent.width; height: 30 color: activePalette.window anchors.bottom: screen.bottom Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: SameGame.startNewGame() } Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: Who knows?" - font.bold: true } } } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml index 737d886..4ed856b 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml @@ -7,9 +7,9 @@ Rectangle { signal clicked - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true + width: buttonLabel.width + 20; height: buttonLabel.height + 5 border { width: 1; color: Qt.darker(activePalette.button) } + smooth: true radius: 8 // color the button with a gradient @@ -26,7 +26,16 @@ Rectangle { GradientStop { position: 1.0; color: activePalette.button } } - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } - Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText } + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml index 6848534..2f45362 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml @@ -1,30 +1,59 @@ import Qt 4.7 +//![0] Rectangle { - id: page + id: container +//![0] +//![1] + property string inputText: textInput.text signal closed - function forceClose() { - page.closed(); - page.opacity = 0; + function show(text) { + dialogText.text = text; + container.opacity = 1; + textInput.opacity = 0; } - function show(txt) { - dialogText.text = txt; - page.opacity = 1; + function showWithInput(text) { + show(text); + textInput.opacity = 1; + textInput.text = "" } - width: dialogText.width + 20; height: dialogText.height + 20 - color: "white" - border.width: 1 + function hide() { + container.opacity = 0; + container.closed(); + } +//![1] + + width: dialogText.width + textInput.width + 20 + height: dialogText.height + 20 opacity: 0 - Behavior on opacity { - NumberAnimation { duration: 1000 } + Text { + id: dialogText + anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: 10 } + text: "" + } + +//![2] + TextInput { + id: textInput + anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } + width: 80 + focus: true + text: "" + + onAccepted: container.hide() // close dialog when Enter is pressed } +//![2] - Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } + MouseArea { + anchors.fill: parent + onClicked: hide(); + } - MouseArea { anchors.fill: parent; onClicked: forceClose(); } +//![3] } +//![3] diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js index 1454f0b..0505b8d 100755 --- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js @@ -25,8 +25,8 @@ function startNewGame() { maxIndex = maxRow * maxColumn; //Close dialogs - nameInputDialog.forceClose(); - dialog.forceClose(); + nameInputDialog.hide(); + dialog.hide(); //Initialize Board board = new Array(maxIndex); @@ -45,18 +45,17 @@ function createBlock(column, row) { if (component == null) component = Qt.createComponent("content/BoomBlock.qml"); - // Note that if Block.qml was not a local file, component.isReady would be - // false and we should wait for the component's statusChanged() signal to - // know when the file is downloaded and fully loaded before calling createObject(). - if (component.isReady) { - var dynamicObject = component.createObject(); + // Note that if Block.qml was not a local file, component.status would be + // Loading and we should wait for the component's statusChanged() signal to + // know when the file is downloaded and ready before calling createObject(). + if (component.status == Component.Ready) { + var dynamicObject = component.createObject(gameCanvas); if (dynamicObject == null) { console.log("error creating block"); console.log(component.errorsString()); return false; } dynamicObject.type = Math.floor(Math.random() * 3); - dynamicObject.parent = gameCanvas; dynamicObject.x = column * gameCanvas.blockSize; dynamicObject.targetX = column * gameCanvas.blockSize; dynamicObject.targetY = row * gameCanvas.blockSize; @@ -72,10 +71,9 @@ function createBlock(column, row) { return true; } -var fillFound; -//Set after a floodFill call to the number of blocks found -var floodBoard; -//Set to 1 if the floodFill reaches off that node +var fillFound; //Set after a floodFill call to the number of blocks found +var floodBoard; //Set to 1 if the floodFill reaches off that node + function handleClick(xPos, yPos) { var column = Math.floor(xPos / gameCanvas.blockSize); var row = Math.floor(yPos / gameCanvas.blockSize); @@ -157,7 +155,9 @@ function shuffleDown() { } } +//![3] function victoryCheck() { +//![3] //Award bonus points if no blocks left var deservesBonus = true; for (var column = maxColumn - 1; column >= 0; column--) @@ -166,12 +166,14 @@ function victoryCheck() { if (deservesBonus) gameCanvas.score += 500; +//![4] //Check whether game has finished if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) { gameDuration = new Date() - gameDuration; - nameInputDialog.show("You won! Please enter your name: "); + nameInputDialog.showWithInput("You won! Please enter your name: "); } } +//![4] //only floods up and right, to see if it can find adjacent same-typed blocks function floodMoveCheck(column, row, type) { diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml index 404af0a..feb61fd 100644 --- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml @@ -25,7 +25,7 @@ Rectangle { property int score: 0 property int blockSize: 40 - z: 20; anchors.centerIn: parent + anchors.centerIn: parent width: parent.width - (parent.width % blockSize); height: parent.height - (parent.height % blockSize); @@ -35,53 +35,41 @@ Rectangle { } } - Dialog { id: dialog; anchors.centerIn: parent; z: 21 } + Dialog { + id: dialog + anchors.centerIn: parent + z: 100 + } //![0] Dialog { id: nameInputDialog - anchors.centerIn: parent - z: 22 + z: 100 - Text { - id: dialogText - opacity: 0 - text: " You won! Please enter your name:" - } - - TextInput { - id: nameInput - width: 72 - anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } - focus: true - - onAccepted: { - if (nameInputDialog.opacity == 1 && nameInput.text != "") - SameGame.saveHighScore(nameInput.text); - nameInputDialog.forceClose(); - } + onClosed: { + if (nameInputDialog.inputText != "") + SameGame.saveHighScore(nameInputDialog.inputText); } } //![0] Rectangle { id: toolBar - width: parent.width; height: 32 + width: parent.width; height: 30 color: activePalette.window anchors.bottom: screen.bottom Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: SameGame.startNewGame() } Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: " + gameCanvas.score - font.bold: true } } } diff --git a/examples/declarative/tutorials/tutorials.pro b/examples/declarative/tutorials/tutorials.pro new file mode 100644 index 0000000..0a82c1e --- /dev/null +++ b/examples/declarative/tutorials/tutorials.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + extending + diff --git a/examples/declarative/tvtennis/click.wav b/examples/declarative/tvtennis/click.wav Binary files differdeleted file mode 100644 index 26c46f8..0000000 --- a/examples/declarative/tvtennis/click.wav +++ /dev/null diff --git a/examples/declarative/tvtennis/paddle.wav b/examples/declarative/tvtennis/paddle.wav Binary files differdeleted file mode 100644 index 604e0e5..0000000 --- a/examples/declarative/tvtennis/paddle.wav +++ /dev/null diff --git a/examples/declarative/flipable/content/5_heart.png b/examples/declarative/ui-components/flipable/content/5_heart.png Binary files differindex fb59d81..fb59d81 100644 --- a/examples/declarative/flipable/content/5_heart.png +++ b/examples/declarative/ui-components/flipable/content/5_heart.png diff --git a/examples/declarative/flipable/content/9_club.png b/examples/declarative/ui-components/flipable/content/9_club.png Binary files differindex 2545001..2545001 100644 --- a/examples/declarative/flipable/content/9_club.png +++ b/examples/declarative/ui-components/flipable/content/9_club.png diff --git a/examples/declarative/flipable/content/Card.qml b/examples/declarative/ui-components/flipable/content/Card.qml index 2577d89..2577d89 100644 --- a/examples/declarative/flipable/content/Card.qml +++ b/examples/declarative/ui-components/flipable/content/Card.qml diff --git a/examples/declarative/flipable/content/back.png b/examples/declarative/ui-components/flipable/content/back.png Binary files differindex f715d74..f715d74 100644 --- a/examples/declarative/flipable/content/back.png +++ b/examples/declarative/ui-components/flipable/content/back.png diff --git a/examples/declarative/flipable/flipable-example.qml b/examples/declarative/ui-components/flipable/flipable-example.qml index 4e09569..4e09569 100644 --- a/examples/declarative/flipable/flipable-example.qml +++ b/examples/declarative/ui-components/flipable/flipable-example.qml diff --git a/examples/declarative/ui-components/flipable/flipable.qmlproject b/examples/declarative/ui-components/flipable/flipable.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/ui-components/flipable/flipable.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/progressbar/content/ProgressBar.qml b/examples/declarative/ui-components/progressbar/content/ProgressBar.qml index bc36df5..bc36df5 100644 --- a/examples/declarative/progressbar/content/ProgressBar.qml +++ b/examples/declarative/ui-components/progressbar/content/ProgressBar.qml diff --git a/examples/declarative/progressbar/content/background.png b/examples/declarative/ui-components/progressbar/content/background.png Binary files differindex 9044226..9044226 100644 --- a/examples/declarative/progressbar/content/background.png +++ b/examples/declarative/ui-components/progressbar/content/background.png diff --git a/examples/declarative/ui-components/progressbar/progressbar.qmlproject b/examples/declarative/ui-components/progressbar/progressbar.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/ui-components/progressbar/progressbar.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/progressbar/progressbars.qml b/examples/declarative/ui-components/progressbar/progressbars.qml index 55fd682..55fd682 100644 --- a/examples/declarative/progressbar/progressbars.qml +++ b/examples/declarative/ui-components/progressbar/progressbars.qml diff --git a/examples/declarative/ui-components/scrollbar/ScrollBar.qml b/examples/declarative/ui-components/scrollbar/ScrollBar.qml new file mode 100644 index 0000000..c628a20 --- /dev/null +++ b/examples/declarative/ui-components/scrollbar/ScrollBar.qml @@ -0,0 +1,33 @@ +import Qt 4.7 + +Item { + id: scrollBar + + // The properties that define the scrollbar's state. + // position and pageSize are in the range 0.0 - 1.0. They are relative to the + // height of the page, i.e. a pageSize of 0.5 means that you can see 50% + // of the height of the view. + // orientation can be either Qt.Vertical or Qt.Horizontal + property real position + property real pageSize + property variant orientation : Qt.Vertical + + // A light, semi-transparent background + Rectangle { + id: background + anchors.fill: parent + radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1) + color: "white" + opacity: 0.3 + } + // Size the bar to the required size, depending upon the orientation. + Rectangle { + x: orientation == Qt.Vertical ? 1 : (scrollBar.position * (scrollBar.width-2) + 1) + y: orientation == Qt.Vertical ? (scrollBar.position * (scrollBar.height-2) + 1) : 1 + width: orientation == Qt.Vertical ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2)) + height: orientation == Qt.Vertical ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2) + radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1) + color: "black" + opacity: 0.7 + } +} diff --git a/examples/declarative/scrollbar/display.qml b/examples/declarative/ui-components/scrollbar/display.qml index cb1da16..6b12d85 100644 --- a/examples/declarative/scrollbar/display.qml +++ b/examples/declarative/ui-components/scrollbar/display.qml @@ -20,7 +20,7 @@ Rectangle { // Only show the scrollbars when the view is moving. states: State { name: "ShowBars" - when: view.moving + when: view.movingVertically || view.movingHorizontally PropertyChanges { target: verticalScrollBar; opacity: 1 } PropertyChanges { target: horizontalScrollBar; opacity: 1 } } @@ -37,7 +37,7 @@ Rectangle { width: 12; height: view.height-12 anchors.right: view.right opacity: 0 - orientation: "Vertical" + orientation: Qt.Vertical position: view.visibleArea.yPosition pageSize: view.visibleArea.heightRatio } @@ -47,7 +47,7 @@ Rectangle { width: view.width-12; height: 12 anchors.bottom: view.bottom opacity: 0 - orientation: "Horizontal" + orientation: Qt.Horizontal position: view.visibleArea.xPosition pageSize: view.visibleArea.widthRatio } diff --git a/examples/declarative/scrollbar/pics/niagara_falls.jpg b/examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg Binary files differindex 618d808..618d808 100644 --- a/examples/declarative/scrollbar/pics/niagara_falls.jpg +++ b/examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg diff --git a/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject b/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/searchbox/SearchBox.qml b/examples/declarative/ui-components/searchbox/SearchBox.qml index aae7ee9..aae7ee9 100644 --- a/examples/declarative/searchbox/SearchBox.qml +++ b/examples/declarative/ui-components/searchbox/SearchBox.qml diff --git a/examples/declarative/searchbox/images/edit-clear-locationbar-rtl.png b/examples/declarative/ui-components/searchbox/images/edit-clear-locationbar-rtl.png Binary files differindex 91eb270..91eb270 100644 --- a/examples/declarative/searchbox/images/edit-clear-locationbar-rtl.png +++ b/examples/declarative/ui-components/searchbox/images/edit-clear-locationbar-rtl.png diff --git a/examples/declarative/searchbox/images/lineedit-bg-focus.png b/examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png Binary files differindex bbfac38..bbfac38 100644 --- a/examples/declarative/searchbox/images/lineedit-bg-focus.png +++ b/examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png diff --git a/examples/declarative/searchbox/images/lineedit-bg.png b/examples/declarative/ui-components/searchbox/images/lineedit-bg.png Binary files differindex 9044226..9044226 100644 --- a/examples/declarative/searchbox/images/lineedit-bg.png +++ b/examples/declarative/ui-components/searchbox/images/lineedit-bg.png diff --git a/examples/declarative/searchbox/main.qml b/examples/declarative/ui-components/searchbox/main.qml index 9f73473..9f73473 100644 --- a/examples/declarative/searchbox/main.qml +++ b/examples/declarative/ui-components/searchbox/main.qml diff --git a/examples/declarative/ui-components/searchbox/searchbox.qmlproject b/examples/declarative/ui-components/searchbox/searchbox.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/ui-components/searchbox/searchbox.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/slideswitch/content/Switch.qml b/examples/declarative/ui-components/slideswitch/content/Switch.qml index a8fa6ef..526a171 100644 --- a/examples/declarative/slideswitch/content/Switch.qml +++ b/examples/declarative/ui-components/slideswitch/content/Switch.qml @@ -45,7 +45,7 @@ Item { MouseArea { anchors.fill: parent - drag.target: knob; drag.axis: "XAxis"; drag.minimumX: 1; drag.maximumX: 78 + drag.target: knob; drag.axis: Drag.XAxis; drag.minimumX: 1; drag.maximumX: 78 onClicked: toggle() onReleased: dorelease() } @@ -69,7 +69,7 @@ Item { //![7] transitions: Transition { - NumberAnimation { properties: "x"; easing.type: "InOutQuad"; duration: 200 } + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 } } //![7] } diff --git a/examples/declarative/slideswitch/content/background.svg b/examples/declarative/ui-components/slideswitch/content/background.svg index f920d3e..f920d3e 100644 --- a/examples/declarative/slideswitch/content/background.svg +++ b/examples/declarative/ui-components/slideswitch/content/background.svg diff --git a/examples/declarative/slideswitch/content/knob.svg b/examples/declarative/ui-components/slideswitch/content/knob.svg index fb69337..fb69337 100644 --- a/examples/declarative/slideswitch/content/knob.svg +++ b/examples/declarative/ui-components/slideswitch/content/knob.svg diff --git a/examples/declarative/slideswitch/slideswitch.qml b/examples/declarative/ui-components/slideswitch/slideswitch.qml index 51c3c77..51c3c77 100644 --- a/examples/declarative/slideswitch/slideswitch.qml +++ b/examples/declarative/ui-components/slideswitch/slideswitch.qml diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject b/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/ui-components/spinner/content/Spinner.qml b/examples/declarative/ui-components/spinner/content/Spinner.qml new file mode 100644 index 0000000..8145a28 --- /dev/null +++ b/examples/declarative/ui-components/spinner/content/Spinner.qml @@ -0,0 +1,25 @@ +import Qt 4.7 + +Image { + property alias model: view.model + property alias delegate: view.delegate + property alias currentIndex: view.currentIndex + property real itemHeight: 30 + source: "spinner-bg.png" + clip: true + PathView { + id: view + anchors.fill: parent + pathItemCount: height/itemHeight + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + highlight: Image { source: "spinner-select.png"; width: view.width; height: itemHeight+4 } + dragMargin: view.width/2 + path: Path { + startX: view.width/2; startY: -itemHeight/2 + PathLine { x: view.width/2; y: view.pathItemCount*itemHeight + itemHeight } + } + } + Keys.onDownPressed: view.incrementCurrentIndex() + Keys.onUpPressed: view.decrementCurrentIndex() +} diff --git a/examples/declarative/ui-components/spinner/content/spinner-bg.png b/examples/declarative/ui-components/spinner/content/spinner-bg.png Binary files differnew file mode 100644 index 0000000..b3556f1 --- /dev/null +++ b/examples/declarative/ui-components/spinner/content/spinner-bg.png diff --git a/examples/declarative/ui-components/spinner/content/spinner-select.png b/examples/declarative/ui-components/spinner/content/spinner-select.png Binary files differnew file mode 100644 index 0000000..95a17a1 --- /dev/null +++ b/examples/declarative/ui-components/spinner/content/spinner-select.png diff --git a/examples/declarative/ui-components/spinner/main.qml b/examples/declarative/ui-components/spinner/main.qml new file mode 100644 index 0000000..6be567a --- /dev/null +++ b/examples/declarative/ui-components/spinner/main.qml @@ -0,0 +1,18 @@ +import Qt 4.7 +import "content" + +Rectangle { + width: 240; height: 320 + Column { + y: 20; x: 20; spacing: 20 + Spinner { + id: spinner + width: 200; height: 240 + focus: true + model: 20 + itemHeight: 30 + delegate: Text { font.pixelSize: 25; text: index; height: 30 } + } + Text { text: "Current item index: " + spinner.currentIndex } + } +} diff --git a/examples/declarative/ui-components/spinner/spinner.qmlproject b/examples/declarative/ui-components/spinner/spinner.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/ui-components/spinner/spinner.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/tabwidget/TabWidget.qml b/examples/declarative/ui-components/tabwidget/TabWidget.qml index 26d25b4..26d25b4 100644 --- a/examples/declarative/tabwidget/TabWidget.qml +++ b/examples/declarative/ui-components/tabwidget/TabWidget.qml diff --git a/examples/declarative/tabwidget/tab.png b/examples/declarative/ui-components/tabwidget/tab.png Binary files differindex ad80216..ad80216 100644 --- a/examples/declarative/tabwidget/tab.png +++ b/examples/declarative/ui-components/tabwidget/tab.png diff --git a/examples/declarative/tabwidget/tabs.qml b/examples/declarative/ui-components/tabwidget/tabs.qml index fba203c..fba203c 100644 --- a/examples/declarative/tabwidget/tabs.qml +++ b/examples/declarative/ui-components/tabwidget/tabs.qml diff --git a/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject b/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/ui-components/ui-components.qmlproject b/examples/declarative/ui-components/ui-components.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/ui-components/ui-components.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/xml/xml.qmlproject b/examples/declarative/xml/xml.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/xml/xml.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/xmlhttprequest/test.qml b/examples/declarative/xml/xmlhttprequest/test.qml index c7e7e6d..c7e7e6d 100644 --- a/examples/declarative/xmlhttprequest/test.qml +++ b/examples/declarative/xml/xmlhttprequest/test.qml diff --git a/examples/declarative/xmlhttprequest/test.xml b/examples/declarative/xml/xmlhttprequest/test.xml index 8b7f1e1..8b7f1e1 100644 --- a/examples/declarative/xmlhttprequest/test.xml +++ b/examples/declarative/xml/xmlhttprequest/test.xml diff --git a/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject b/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/xmldata/daringfireball.qml b/examples/declarative/xmldata/daringfireball.qml deleted file mode 100644 index a1df809..0000000 --- a/examples/declarative/xmldata/daringfireball.qml +++ /dev/null @@ -1,48 +0,0 @@ -import Qt 4.7 - -Rectangle { - color: "white" - width: 600; height: 600 - - XmlListModel { - id: feedModel - source: "http://daringfireball.net/index.xml" - query: "/feed/entry" - namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';" - XmlRole { name: "title"; query: "title/string()" } - XmlRole { name: "tagline"; query: "author/name/string()" } - XmlRole { name: "content"; query: "content/string()" } - } - - Component { - id: feedDelegate - Item { - height: childrenRect.height + 20 - Text { - id: titleText - x: 10 - text: title; font.bold: true - } - Text { - anchors { left: titleText.right; leftMargin: 10 } - text: 'by ' + tagline - font.italic: true - } - Text { - x: 10 - width: 580 - anchors.top: titleText.bottom - text: content - wrapMode: Text.WordWrap - - onLinkActivated: { console.log('link clicked: ' + link) } - } - } - } - - ListView { - anchors.fill: parent - model: feedModel - delegate: feedDelegate - } -} diff --git a/examples/declarative/xmldata/yahoonews.qml b/examples/declarative/xmldata/yahoonews.qml deleted file mode 100644 index 668778e..0000000 --- a/examples/declarative/xmldata/yahoonews.qml +++ /dev/null @@ -1,83 +0,0 @@ -import Qt 4.7 - -Rectangle { - width: 600; height: 600 - - gradient: Gradient { - GradientStop { position: 0; color: "black" } - GradientStop { position: 1.0; color: "#AAAAAA" } - } - - XmlListModel { - id: feedModel - source: "http://rss.news.yahoo.com/rss/oceania" - query: "/rss/channel/item" - XmlRole { name: "title"; query: "title/string()" } - XmlRole { name: "link"; query: "link/string()" } - XmlRole { name: "description"; query: "description/string()" } - } - - Component { - id: feedDelegate - - Item { - id: delegate - height: wrapper.height + 10 - - MouseArea { - anchors.fill: wrapper - onPressed: delegate.ListView.view.currentIndex = index; - onClicked: if (wrapper.state == 'Details') wrapper.state = ''; else wrapper.state = 'Details'; - } - - Rectangle { - id: wrapper - - width: 580; y: 5; height: titleText.height + 10 - color: "#F0F0F0" - radius: 5 - - Text { - id: titleText - x: 10; y: 5 - text: '<a href=\'' + link + '\'>' + title + '</a>' - font { bold: true; family: "Helvetica"; pointSize: 14 } - - onLinkActivated: { console.log('link clicked: ' + link) } - } - - Text { - id: descriptionText - x: 10; width: 560 - anchors.top: titleText.bottom; anchors.topMargin: 5 - text: description - wrapMode: Text.WordWrap - font.family: "Helvetica" - opacity: 0 - } - - states: State { - name: "Details" - PropertyChanges { target: wrapper; height: childrenRect.height + 10 } - PropertyChanges { target: descriptionText; opacity: 1 } - } - - transitions: Transition { - from: "*"; to: "Details"; reversible: true - SequentialAnimation { - NumberAnimation { duration: 200; properties: "height"; easing.type: "OutQuad" } - NumberAnimation { duration: 200; properties: "opacity" } - } - } - } - } - } - - ListView { - id: list - x: 10; y: 10 - width: parent.width - 20; height: parent.height - 20 - model: feedModel - delegate: feedDelegate - } -} diff --git a/examples/graphicsview/padnavigator/flippablepad.cpp b/examples/graphicsview/padnavigator/flippablepad.cpp new file mode 100644 index 0000000..58aea00 --- /dev/null +++ b/examples/graphicsview/padnavigator/flippablepad.cpp @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "flippablepad.h" + +#include <QtGui/QtGui> + +//! [0] +static QRectF boundsFromSize(const QSize &size) +{ + return QRectF((-size.width() / 2.0) * 150, (-size.height() / 2.0) * 150, + size.width() * 150, size.height() * 150); +} +//! [0] + +//! [1] +static QPointF posForLocation(int column, int row, const QSize &size) +{ + return QPointF(column * 150, row * 150) + - QPointF((size.width() - 1) * 75, (size.height() - 1) * 75); +} +//! [1] + +//! [2] +FlippablePad::FlippablePad(const QSize &size, QGraphicsItem *parent) + : RoundRectItem(boundsFromSize(size), QColor(226, 255, 92, 64), parent) +{ +//! [2] +//! [3] + int numIcons = size.width() * size.height(); + QList<QPixmap> pixmaps; + QDirIterator it(":/images", QStringList() << "*.png"); + while (it.hasNext() && pixmaps.size() < numIcons) + pixmaps << it.next(); +//! [3] + +//! [4] + const QRectF iconRect(-54, -54, 108, 108); + const QColor iconColor(214, 240, 110, 128); + iconGrid.resize(size.height()); + int n = 0; + + for (int y = 0; y < size.height(); ++y) { + iconGrid[y].resize(size.width()); + for (int x = 0; x < size.width(); ++x) { + RoundRectItem *rect = new RoundRectItem(iconRect, iconColor, this); + rect->setZValue(1); + rect->setPos(posForLocation(x, y, size)); + rect->setPixmap(pixmaps.at(n++ % pixmaps.size())); + iconGrid[y][x] = rect; + } + } +} +//! [4] + +//! [5] +RoundRectItem *FlippablePad::iconAt(int column, int row) const +{ + return iconGrid[row][column]; +} +//! [5] diff --git a/examples/graphicsview/padnavigator/flippablepad.h b/examples/graphicsview/padnavigator/flippablepad.h new file mode 100644 index 0000000..7d99536 --- /dev/null +++ b/examples/graphicsview/padnavigator/flippablepad.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FLIPPABLEPAD_H +#define FLIPPABLEPAD_H + +#include "roundrectitem.h" + +#include <QGraphicsObject> +#include <QLinearGradient> +#include <QVector> + +//! [0] +class FlippablePad : public RoundRectItem +{ +public: + FlippablePad(const QSize &size, QGraphicsItem *parent = 0); + + RoundRectItem *iconAt(int column, int row) const; + +private: + QVector<QVector<RoundRectItem *> > iconGrid; +}; +//! [0] + +#endif // FLIPPABLEPAD_H diff --git a/examples/graphicsview/padnavigator/backside.ui b/examples/graphicsview/padnavigator/form.ui index afa488c..fc7d123 100644 --- a/examples/graphicsview/padnavigator/backside.ui +++ b/examples/graphicsview/padnavigator/form.ui @@ -1,6 +1,6 @@ <ui version="4.0" > - <class>BackSide</class> - <widget class="QWidget" name="BackSide" > + <class>Form</class> + <widget class="QWidget" name="Form" > <property name="geometry" > <rect> <x>0</x> diff --git a/examples/graphicsview/padnavigator/main.cpp b/examples/graphicsview/padnavigator/main.cpp index fb6c120..984b976 100644 --- a/examples/graphicsview/padnavigator/main.cpp +++ b/examples/graphicsview/padnavigator/main.cpp @@ -39,21 +39,19 @@ ** ****************************************************************************/ -#include <QtGui> -#ifndef QT_NO_OPENGL -# include <QtOpenGL> -#endif +#include "padnavigator.h" -#include "panel.h" +#include <QtGui/QtGui> +//! [0] int main(int argc, char *argv[]) { QApplication app(argc, argv); Q_INIT_RESOURCE(padnavigator); - Panel panel(3, 3); - panel.setFocus(); - panel.show(); + PadNavigator navigator(QSize(3, 3)); + navigator.show(); return app.exec(); } +//! [0] diff --git a/examples/graphicsview/padnavigator/padnavigator.cpp b/examples/graphicsview/padnavigator/padnavigator.cpp new file mode 100644 index 0000000..b1d19f6 --- /dev/null +++ b/examples/graphicsview/padnavigator/padnavigator.cpp @@ -0,0 +1,307 @@ +/**************************************************************************** +** +** 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:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "flippablepad.h" +#include "padnavigator.h" +#include "splashitem.h" + +#include <QtGui/QtGui> +#ifndef QT_NO_OPENGL +#include <QtOpenGL/QtOpenGL> +#endif + +//! [0] +PadNavigator::PadNavigator(const QSize &size, QWidget *parent) + : QGraphicsView(parent) +{ +//! [0] +//! [1] + // Splash item + SplashItem *splash = new SplashItem; + splash->setZValue(1); +//! [1] + +//! [2] + // Pad item + FlippablePad *pad = new FlippablePad(size); + QGraphicsRotation *flipRotation = new QGraphicsRotation(pad); + QGraphicsRotation *xRotation = new QGraphicsRotation(pad); + QGraphicsRotation *yRotation = new QGraphicsRotation(pad); + flipRotation->setAxis(Qt::YAxis); + xRotation->setAxis(Qt::YAxis); + yRotation->setAxis(Qt::XAxis); + pad->setTransformations(QList<QGraphicsTransform *>() + << flipRotation + << xRotation << yRotation); +//! [2] + +//! [3] + // Back (proxy widget) item + QGraphicsProxyWidget *backItem = new QGraphicsProxyWidget(pad); + QWidget *widget = new QWidget; + form.setupUi(widget); + form.hostName->setFocus(); + backItem->setWidget(widget); + backItem->setVisible(false); + backItem->setFocus(); + backItem->setCacheMode(QGraphicsItem::ItemCoordinateCache); + const QRectF r = backItem->rect(); + backItem->setTransform(QTransform() + .rotate(180, Qt::YAxis) + .translate(-r.width()/2, -r.height()/2)); +//! [3] + +//! [4] + // Selection item + RoundRectItem *selectionItem = new RoundRectItem(QRectF(-60, -60, 120, 120), + Qt::gray, pad); + selectionItem->setZValue(0.5); +//! [4] + +//! [5] + // Splash animations + QPropertyAnimation *smoothSplashMove = new QPropertyAnimation(splash, "y"); + QPropertyAnimation *smoothSplashOpacity = new QPropertyAnimation(splash, "opacity"); + smoothSplashMove->setEasingCurve(QEasingCurve::InQuad); + smoothSplashMove->setDuration(250); + smoothSplashOpacity->setDuration(250); +//! [5] + +//! [6] + // Selection animation + QPropertyAnimation *smoothXSelection = new QPropertyAnimation(selectionItem, "x"); + QPropertyAnimation *smoothYSelection = new QPropertyAnimation(selectionItem, "y"); + QPropertyAnimation *smoothXRotation = new QPropertyAnimation(xRotation, "angle"); + QPropertyAnimation *smoothYRotation = new QPropertyAnimation(yRotation, "angle"); + smoothXSelection->setDuration(125); + smoothYSelection->setDuration(125); + smoothXRotation->setDuration(125); + smoothYRotation->setDuration(125); + smoothXSelection->setEasingCurve(QEasingCurve::InOutQuad); + smoothYSelection->setEasingCurve(QEasingCurve::InOutQuad); + smoothXRotation->setEasingCurve(QEasingCurve::InOutQuad); + smoothYRotation->setEasingCurve(QEasingCurve::InOutQuad); +//! [6] + +//! [7] + // Flip animation setup + QPropertyAnimation *smoothFlipRotation = new QPropertyAnimation(flipRotation, "angle"); + QPropertyAnimation *smoothFlipScale = new QPropertyAnimation(pad, "scale"); + QPropertyAnimation *smoothFlipXRotation = new QPropertyAnimation(xRotation, "angle"); + QPropertyAnimation *smoothFlipYRotation = new QPropertyAnimation(yRotation, "angle"); + QParallelAnimationGroup *flipAnimation = new QParallelAnimationGroup(this); + smoothFlipScale->setDuration(500); + smoothFlipRotation->setDuration(500); + smoothFlipXRotation->setDuration(500); + smoothFlipYRotation->setDuration(500); + smoothFlipScale->setEasingCurve(QEasingCurve::InOutQuad); + smoothFlipRotation->setEasingCurve(QEasingCurve::InOutQuad); + smoothFlipXRotation->setEasingCurve(QEasingCurve::InOutQuad); + smoothFlipYRotation->setEasingCurve(QEasingCurve::InOutQuad); + smoothFlipScale->setKeyValueAt(0, qVariantValue<qreal>(1.0)); + smoothFlipScale->setKeyValueAt(0.5, qVariantValue<qreal>(0.7)); + smoothFlipScale->setKeyValueAt(1, qVariantValue<qreal>(1.0)); + flipAnimation->addAnimation(smoothFlipRotation); + flipAnimation->addAnimation(smoothFlipScale); + flipAnimation->addAnimation(smoothFlipXRotation); + flipAnimation->addAnimation(smoothFlipYRotation); +//! [7] + +//! [8] + // Flip animation delayed property assignment + QSequentialAnimationGroup *setVariablesSequence = new QSequentialAnimationGroup; + QPropertyAnimation *setFillAnimation = new QPropertyAnimation(pad, "fill"); + QPropertyAnimation *setBackItemVisibleAnimation = new QPropertyAnimation(backItem, "visible"); + QPropertyAnimation *setSelectionItemVisibleAnimation = new QPropertyAnimation(selectionItem, "visible"); + setFillAnimation->setDuration(0); + setBackItemVisibleAnimation->setDuration(0); + setSelectionItemVisibleAnimation->setDuration(0); + setVariablesSequence->addPause(250); + setVariablesSequence->addAnimation(setBackItemVisibleAnimation); + setVariablesSequence->addAnimation(setSelectionItemVisibleAnimation); + setVariablesSequence->addAnimation(setFillAnimation); + flipAnimation->addAnimation(setVariablesSequence); +//! [8] + +//! [9] + // Build the state machine + QStateMachine *stateMachine = new QStateMachine(this); + QState *splashState = new QState(stateMachine); + QState *frontState = new QState(stateMachine); + QHistoryState *historyState = new QHistoryState(frontState); + QState *backState = new QState(stateMachine); +//! [9] +//! [10] + frontState->assignProperty(pad, "fill", false); + frontState->assignProperty(splash, "opacity", 0.0); + frontState->assignProperty(backItem, "visible", false); + frontState->assignProperty(flipRotation, "angle", qVariantValue<qreal>(0.0)); + frontState->assignProperty(selectionItem, "visible", true); + backState->assignProperty(pad, "fill", true); + backState->assignProperty(backItem, "visible", true); + backState->assignProperty(xRotation, "angle", qVariantValue<qreal>(0.0)); + backState->assignProperty(yRotation, "angle", qVariantValue<qreal>(0.0)); + backState->assignProperty(flipRotation, "angle", qVariantValue<qreal>(180.0)); + backState->assignProperty(selectionItem, "visible", false); + stateMachine->addDefaultAnimation(smoothXRotation); + stateMachine->addDefaultAnimation(smoothYRotation); + stateMachine->addDefaultAnimation(smoothXSelection); + stateMachine->addDefaultAnimation(smoothYSelection); + stateMachine->setInitialState(splashState); +//! [10] + +//! [11] + // Transitions + QEventTransition *anyKeyTransition = new QEventTransition(this, QEvent::KeyPress, splashState); + anyKeyTransition->setTargetState(frontState); + anyKeyTransition->addAnimation(smoothSplashMove); + anyKeyTransition->addAnimation(smoothSplashOpacity); +//! [11] + +//! [12] + QKeyEventTransition *enterTransition = new QKeyEventTransition(this, QEvent::KeyPress, + Qt::Key_Enter, backState); + QKeyEventTransition *returnTransition = new QKeyEventTransition(this, QEvent::KeyPress, + Qt::Key_Return, backState); + QKeyEventTransition *backEnterTransition = new QKeyEventTransition(this, QEvent::KeyPress, + Qt::Key_Enter, frontState); + QKeyEventTransition *backReturnTransition = new QKeyEventTransition(this, QEvent::KeyPress, + Qt::Key_Return, frontState); + enterTransition->setTargetState(historyState); + returnTransition->setTargetState(historyState); + backEnterTransition->setTargetState(backState); + backReturnTransition->setTargetState(backState); + enterTransition->addAnimation(flipAnimation); + returnTransition->addAnimation(flipAnimation); + backEnterTransition->addAnimation(flipAnimation); + backReturnTransition->addAnimation(flipAnimation); +//! [12] + +//! [13] + // Create substates for each icon; store in temporary grid. + int columns = size.width(); + int rows = size.height(); + QVector< QVector< QState * > > stateGrid; + stateGrid.resize(rows); + for (int y = 0; y < rows; ++y) { + stateGrid[y].resize(columns); + for (int x = 0; x < columns; ++x) + stateGrid[y][x] = new QState(frontState); + } + frontState->setInitialState(stateGrid[0][0]); + selectionItem->setPos(pad->iconAt(0, 0)->pos()); +//! [13] + +//! [14] + // Enable key navigation using state transitions + for (int y = 0; y < rows; ++y) { + for (int x = 0; x < columns; ++x) { + QState *state = stateGrid[y][x]; + QKeyEventTransition *rightTransition = new QKeyEventTransition(this, QEvent::KeyPress, + Qt::Key_Right, state); + QKeyEventTransition *leftTransition = new QKeyEventTransition(this, QEvent::KeyPress, + Qt::Key_Left, state); + QKeyEventTransition *downTransition = new QKeyEventTransition(this, QEvent::KeyPress, + Qt::Key_Down, state); + QKeyEventTransition *upTransition = new QKeyEventTransition(this, QEvent::KeyPress, + Qt::Key_Up, state); + rightTransition->setTargetState(stateGrid[y][(x + 1) % columns]); + leftTransition->setTargetState(stateGrid[y][((x - 1) + columns) % columns]); + downTransition->setTargetState(stateGrid[(y + 1) % rows][x]); + upTransition->setTargetState(stateGrid[((y - 1) + rows) % rows][x]); +//! [14] +//! [15] + RoundRectItem *icon = pad->iconAt(x, y); + state->assignProperty(xRotation, "angle", -icon->x() / 6.0); + state->assignProperty(yRotation, "angle", icon->y() / 6.0); + state->assignProperty(selectionItem, "x", icon->x()); + state->assignProperty(selectionItem, "y", icon->y()); + frontState->assignProperty(icon, "visible", true); + backState->assignProperty(icon, "visible", false); + + QPropertyAnimation *setIconVisibleAnimation = new QPropertyAnimation(icon, "visible"); + setIconVisibleAnimation->setDuration(0); + setVariablesSequence->addAnimation(setIconVisibleAnimation); + } + } +//! [15] + +//! [16] + // Scene + QGraphicsScene *scene = new QGraphicsScene(this); + scene->setBackgroundBrush(QPixmap(":/images/blue_angle_swirl.jpg")); + scene->setItemIndexMethod(QGraphicsScene::NoIndex); + scene->addItem(pad); + scene->setSceneRect(scene->itemsBoundingRect()); + setScene(scene); +//! [16] + +//! [17] + // Adjust splash item to scene contents + const QRectF sbr = splash->boundingRect(); + splash->setPos(-sbr.width() / 2, scene->sceneRect().top() - 2); + frontState->assignProperty(splash, "y", splash->y() - 100.0); + scene->addItem(splash); +//! [17] + +//! [18] + // View + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setMinimumSize(50, 50); + setViewportUpdateMode(FullViewportUpdate); + setCacheMode(CacheBackground); + setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing); +#ifndef QT_NO_OPENGL + setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); +#endif + + stateMachine->start(); +//! [18] +} + +//! [19] +void PadNavigator::resizeEvent(QResizeEvent *event) +{ + QGraphicsView::resizeEvent(event); + fitInView(scene()->sceneRect(), Qt::KeepAspectRatio); +} +//! [19] diff --git a/examples/graphicsview/padnavigator/padnavigator.h b/examples/graphicsview/padnavigator/padnavigator.h new file mode 100644 index 0000000..d9298ae --- /dev/null +++ b/examples/graphicsview/padnavigator/padnavigator.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef PADNAVIGATOR_H +#define PADNAVIGATOR_H + +#include <QGraphicsView> +#include "ui_form.h" + +QT_BEGIN_NAMESPACE + +class QState; +class QStateMachine; +class Ui_Form; + +QT_END_NAMESPACE + +//! [0] +class PadNavigator : public QGraphicsView +{ + Q_OBJECT +public: + explicit PadNavigator(const QSize &size, QWidget *parent = 0); + +protected: + void resizeEvent(QResizeEvent *event); + +private: + Ui_Form form; +}; +//! [0] + +#endif // PADNAVIGATOR_H diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro index d6f536c..93ea293 100644 --- a/examples/graphicsview/padnavigator/padnavigator.pro +++ b/examples/graphicsview/padnavigator/padnavigator.pro @@ -1,19 +1,20 @@ -HEADERS += \ - panel.h \ - roundrectitem.h \ - splashitem.h +SOURCES += main.cpp \ + roundrectitem.cpp \ + flippablepad.cpp \ + padnavigator.cpp \ + splashitem.cpp -SOURCES += \ - panel.cpp \ - roundrectitem.cpp \ - splashitem.cpp \ - main.cpp +HEADERS += \ + roundrectitem.h \ + flippablepad.h \ + padnavigator.h \ + splashitem.h RESOURCES += \ - padnavigator.qrc + padnavigator.qrc FORMS += \ - backside.ui + form.ui contains(QT_CONFIG, opengl):QT += opengl diff --git a/examples/graphicsview/padnavigator/panel.cpp b/examples/graphicsview/padnavigator/panel.cpp deleted file mode 100644 index c4a5cd9..0000000 --- a/examples/graphicsview/padnavigator/panel.cpp +++ /dev/null @@ -1,238 +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:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "panel.h" -#include "roundrectitem.h" -#include "splashitem.h" -#include "ui_backside.h" - -#ifndef QT_NO_OPENGL -#include <QtOpenGL/QtOpenGL> -#else -#endif -#include <QtGui/QtGui> - -#include <math.h> - -Panel::Panel(int width, int height) - : selectedX(0), - selectedY(0), - width(width), - height(height), - flipped(false), - flipLeft(true) -{ - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setCacheMode(CacheBackground); - setViewportUpdateMode(FullViewportUpdate); - setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform - | QPainter::TextAntialiasing); - setBackgroundBrush(QPixmap(":/images/blue_angle_swirl.jpg")); -#ifndef QT_NO_OPENGL - setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); -#endif - setMinimumSize(50, 50); - - selectionTimeLine = new QTimeLine(150, this); - flipTimeLine = new QTimeLine(500, this); - - QRectF bounds((-width / 2.0) * 150, (-height / 2.0) * 150, width * 150, height * 150); - - scene = new QGraphicsScene(bounds, this); - scene->setItemIndexMethod(QGraphicsScene::NoIndex); - setScene(scene); - - baseItem = new RoundRectItem(bounds, QColor(226, 255, 92, 64)); - scene->addItem(baseItem); - - QWidget *embed = new QWidget; - ui = new Ui_BackSide; - ui->setupUi(embed); - ui->hostName->setFocus(); - - backItem = new RoundRectItem(bounds, embed->palette().window(), embed); - backItem->setTransform(QTransform().rotate(180, Qt::YAxis)); - backItem->setParentItem(baseItem); - - selectionItem = new RoundRectItem(QRectF(-60, -60, 120, 120), Qt::gray); - selectionItem->setParentItem(baseItem); - selectionItem->setZValue(-1); - selectionItem->setPos(posForLocation(0, 0)); - startPos = selectionItem->pos(); - - grid = new QGraphicsItem **[height]; - - for (int y = 0; y < height; ++y) { - grid[y] = new QGraphicsItem *[width]; - - for (int x = 0; x < width; ++x) { - RoundRectItem *item = new RoundRectItem(QRectF(-54, -54, 108, 108), - QColor(214, 240, 110, 128)); - item->setPos(posForLocation(x, y)); - - item->setParentItem(baseItem); - item->setFlag(QGraphicsItem::ItemIsFocusable); - grid[y][x] = item; - - switch (qrand() % 9) { - case 0: item->setPixmap(QPixmap(":/images/kontact_contacts.png")); break; - case 1: item->setPixmap(QPixmap(":/images/kontact_journal.png")); break; - case 2: item->setPixmap(QPixmap(":/images/kontact_notes.png")); break; - case 3: item->setPixmap(QPixmap(":/images/kopeteavailable.png")); break; - case 4: item->setPixmap(QPixmap(":/images/metacontact_online.png")); break; - case 5: item->setPixmap(QPixmap(":/images/minitools.png")); break; - case 6: item->setPixmap(QPixmap(":/images/kontact_journal.png")); break; - case 7: item->setPixmap(QPixmap(":/images/kontact_contacts.png")); break; - case 8: item->setPixmap(QPixmap(":/images/kopeteavailable.png")); break; - default: - break; - } - - connect(item, SIGNAL(activated()), this, SLOT(flip())); - } - } - - grid[0][0]->setFocus(); - - connect(backItem, SIGNAL(activated()), - this, SLOT(flip())); - connect(selectionTimeLine, SIGNAL(valueChanged(qreal)), - this, SLOT(updateSelectionStep(qreal))); - connect(flipTimeLine, SIGNAL(valueChanged(qreal)), - this, SLOT(updateFlipStep(qreal))); - - splash = new SplashItem; - splash->setZValue(5); - splash->setPos(-splash->rect().width() / 2, scene->sceneRect().top()); - scene->addItem(splash); - - splash->grabKeyboard(); - - updateSelectionStep(0); - - setWindowTitle(tr("Pad Navigator Example")); -} - -Panel::~Panel() -{ - for (int y = 0; y < height; ++y) - delete [] grid[y]; - delete [] grid; -} - -void Panel::keyPressEvent(QKeyEvent *event) -{ - if (splash->isVisible() || event->key() == Qt::Key_Return || flipped) { - QGraphicsView::keyPressEvent(event); - return; - } - - selectedX = (selectedX + width + (event->key() == Qt::Key_Right) - (event->key() == Qt::Key_Left)) % width; - selectedY = (selectedY + height + (event->key() == Qt::Key_Down) - (event->key() == Qt::Key_Up)) % height; - grid[selectedY][selectedX]->setFocus(); - - selectionTimeLine->stop(); - startPos = selectionItem->pos(); - endPos = posForLocation(selectedX, selectedY); - selectionTimeLine->start(); -} - -void Panel::resizeEvent(QResizeEvent *event) -{ - QGraphicsView::resizeEvent(event); - fitInView(scene->sceneRect(), Qt::KeepAspectRatio); -} - -void Panel::updateSelectionStep(qreal val) -{ - QPointF newPos(startPos.x() + (endPos - startPos).x() * val, - startPos.y() + (endPos - startPos).y() * val); - selectionItem->setPos(newPos); - - QTransform transform; - yrot = newPos.x() / 6.0; - xrot = newPos.y() / 6.0; - transform.rotate(newPos.x() / 6.0, Qt::YAxis); - transform.rotate(newPos.y() / 6.0, Qt::XAxis); - baseItem->setTransform(transform); -} - -void Panel::updateFlipStep(qreal val) -{ - qreal finalxrot = xrot - xrot * val; - qreal finalyrot; - if (flipLeft) - finalyrot = yrot - yrot * val - 180 * val; - else - finalyrot = yrot - yrot * val + 180 * val; - QTransform transform; - transform.rotate(finalyrot, Qt::YAxis); - transform.rotate(finalxrot, Qt::XAxis); - qreal scale = 1 - sin(3.14 * val) * 0.3; - transform.scale(scale, scale); - baseItem->setTransform(transform); - if (val == 0) - grid[selectedY][selectedX]->setFocus(); -} - -void Panel::flip() -{ - if (flipTimeLine->state() == QTimeLine::Running) - return; - - if (flipTimeLine->currentValue() == 0) { - flipTimeLine->setDirection(QTimeLine::Forward); - flipTimeLine->start(); - flipped = true; - flipLeft = selectionItem->pos().x() < 0; - } else { - flipTimeLine->setDirection(QTimeLine::Backward); - flipTimeLine->start(); - flipped = false; - } -} - -QPointF Panel::posForLocation(int x, int y) const -{ - return QPointF(x * 150, y * 150) - - QPointF((width - 1) * 75, (height - 1) * 75); -} diff --git a/examples/graphicsview/padnavigator/panel.h b/examples/graphicsview/padnavigator/panel.h deleted file mode 100644 index 908092b..0000000 --- a/examples/graphicsview/padnavigator/panel.h +++ /dev/null @@ -1,92 +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:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui/qgraphicsview.h> - -QT_BEGIN_NAMESPACE -class QTimeLine; -class Ui_BackSide; -QT_END_NAMESPACE - -class RoundRectItem; - -class Panel : public QGraphicsView -{ - Q_OBJECT -public: - Panel(int width, int height); - ~Panel(); - -protected: - void keyPressEvent(QKeyEvent *event); - void resizeEvent(QResizeEvent *event); - -private Q_SLOTS: - void updateSelectionStep(qreal val); - void updateFlipStep(qreal val); - void flip(); - -private: - QPointF posForLocation(int x, int y) const; - - QGraphicsScene *scene; - RoundRectItem *selectionItem; - RoundRectItem *baseItem; - RoundRectItem *backItem; - QGraphicsWidget *splash; - QTimeLine *selectionTimeLine; - QTimeLine *flipTimeLine; - int selectedX, selectedY; - - QGraphicsItem ***grid; - - QPointF startPos; - QPointF endPos; - qreal xrot, yrot; - qreal xrot2, yrot2; - - int width; - int height; - bool flipped; - bool flipLeft; - - Ui_BackSide *ui; -}; diff --git a/examples/graphicsview/padnavigator/roundrectitem.cpp b/examples/graphicsview/padnavigator/roundrectitem.cpp index d53eea4..7a0b279 100644 --- a/examples/graphicsview/padnavigator/roundrectitem.cpp +++ b/examples/graphicsview/padnavigator/roundrectitem.cpp @@ -43,122 +43,72 @@ #include <QtGui/QtGui> -RoundRectItem::RoundRectItem(const QRectF &rect, const QBrush &brush, QWidget *embeddedWidget) - : QGraphicsRectItem(rect), - brush(brush), - timeLine(75), - lastVal(0), - opa(1), - proxyWidget(0) +//! [0] +RoundRectItem::RoundRectItem(const QRectF &bounds, const QColor &color, + QGraphicsItem *parent) + : QGraphicsObject(parent), fillRect(false), bounds(bounds) { - connect(&timeLine, SIGNAL(valueChanged(qreal)), - this, SLOT(updateValue(qreal))); - - if (embeddedWidget) { - proxyWidget = new QGraphicsProxyWidget(this); - proxyWidget->setFocusPolicy(Qt::StrongFocus); - proxyWidget->setWidget(embeddedWidget); - proxyWidget->setGeometry(boundingRect().adjusted(25, 25, -25, -25)); - } + gradient.setStart(bounds.topLeft()); + gradient.setFinalStop(bounds.bottomRight()); + gradient.setColorAt(0, color); + gradient.setColorAt(1, color.dark(200)); + setCacheMode(ItemCoordinateCache); } +//! [0] -void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) +//! [1] +QPixmap RoundRectItem::pixmap() const { - QTransform x = painter->worldTransform(); - - QLineF unit = x.map(QLineF(0, 0, 1, 1)); - if (unit.p1().x() > unit.p2().x() || unit.p1().y() > unit.p2().y()) { - if (proxyWidget && proxyWidget->isVisible()) { - proxyWidget->hide(); - proxyWidget->setGeometry(rect()); - } - return; - } - - if (proxyWidget && !proxyWidget->isVisible()) { - proxyWidget->show(); - proxyWidget->setFocus(); - } - if (proxyWidget && proxyWidget->pos() != QPoint()) - proxyWidget->setGeometry(boundingRect().adjusted(25, 25, -25, -25)); - - painter->setOpacity(opacity()); - painter->setPen(Qt::NoPen); - painter->setBrush(QColor(0, 0, 0, 64)); - painter->drawRoundRect(rect().translated(2, 2)); - - if (!proxyWidget) { - QLinearGradient gradient(rect().topLeft(), rect().bottomRight()); - const QColor col = brush.color(); - gradient.setColorAt(0, col); - gradient.setColorAt(1, col.dark(int(200 + lastVal * 50))); - painter->setBrush(gradient); - } else { - painter->setBrush(brush); - } - - painter->setPen(QPen(Qt::black, 1)); - painter->drawRoundRect(rect()); - if (!pix.isNull()) { - painter->scale(1.95, 1.95); - painter->drawPixmap(-pix.width() / 2, -pix.height() / 2, pix);; - } + return pix; } - -QRectF RoundRectItem::boundingRect() const -{ - qreal penW = 0.5; - qreal shadowW = 2.0; - return rect().adjusted(-penW, -penW, penW + shadowW, penW + shadowW); -} - void RoundRectItem::setPixmap(const QPixmap &pixmap) { pix = pixmap; - if (scene() && isVisible()) - update(); -} - -qreal RoundRectItem::opacity() const -{ - RoundRectItem *parent = parentItem() ? (RoundRectItem *)parentItem() : 0; - return opa + (parent ? parent->opacity() : 0); + update(); } +//! [1] -void RoundRectItem::setOpacity(qreal opacity) +//! [2] +QRectF RoundRectItem::boundingRect() const { - opa = opacity; - update(); + return bounds.adjusted(0, 0, 2, 2); } +//! [2] -void RoundRectItem::keyPressEvent(QKeyEvent *event) +//! [3] +void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, + QWidget *widget) { - if (event->isAutoRepeat() || event->key() != Qt::Key_Return - || (timeLine.state() == QTimeLine::Running && timeLine.direction() == QTimeLine::Forward)) { - QGraphicsRectItem::keyPressEvent(event); - return; + Q_UNUSED(option); + Q_UNUSED(widget); + painter->setPen(Qt::NoPen); + painter->setBrush(QColor(0, 0, 0, 64)); + painter->drawRoundRect(bounds.translated(2, 2)); +//! [3] +//! [4] + if (fillRect) + painter->setBrush(QApplication::palette().brush(QPalette::Window)); + else + painter->setBrush(gradient); + painter->setPen(QPen(Qt::black, 1)); + painter->drawRoundRect(bounds); +//! [4] +//! [5] + if (!pix.isNull()) { + painter->scale(1.95, 1.95); + painter->drawPixmap(-pix.width() / 2, -pix.height() / 2, pix); } - - timeLine.stop(); - timeLine.setDirection(QTimeLine::Forward); - timeLine.start(); - emit activated(); } +//! [5] -void RoundRectItem::keyReleaseEvent(QKeyEvent *event) +//! [6] +bool RoundRectItem::fill() const { - if (event->key() != Qt::Key_Return) { - QGraphicsRectItem::keyReleaseEvent(event); - return; - } - timeLine.stop(); - timeLine.setDirection(QTimeLine::Backward); - timeLine.start(); + return fillRect; } - -void RoundRectItem::updateValue(qreal value) +void RoundRectItem::setFill(bool fill) { - lastVal = value; - if (!proxyWidget) - setTransform(QTransform().scale(1 - value / 10.0, 1 - value / 10.0)); + fillRect = fill; + update(); } +//! [6] diff --git a/examples/graphicsview/padnavigator/roundrectitem.h b/examples/graphicsview/padnavigator/roundrectitem.h index 683c09f..bc58cec 100644 --- a/examples/graphicsview/padnavigator/roundrectitem.h +++ b/examples/graphicsview/padnavigator/roundrectitem.h @@ -39,45 +39,38 @@ ** ****************************************************************************/ -#include <QtCore/qobject.h> -#include <QtCore/qtimeline.h> -#include <QtGui/qgraphicsitem.h> -#include <QtGui/qbrush.h> +#ifndef ROUNDRECTITEM_H +#define ROUNDRECTITEM_H -QT_BEGIN_NAMESPACE -class QGraphicsProxyWidget; -QT_END_NAMESPACE +#include <QGraphicsObject> +#include <QLinearGradient> -class RoundRectItem : public QObject, public QGraphicsRectItem +//! [0] +class RoundRectItem : public QGraphicsObject { Q_OBJECT + Q_PROPERTY(bool fill READ fill WRITE setFill) public: - RoundRectItem(const QRectF &rect, const QBrush &brush, QWidget *embeddedWidget = 0); - - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *); - QRectF boundingRect() const; + RoundRectItem(const QRectF &bounds, const QColor &color, + QGraphicsItem *parent = 0); + QPixmap pixmap() const; void setPixmap(const QPixmap &pixmap); - qreal opacity() const; - void setOpacity(qreal opacity); - -Q_SIGNALS: - void activated(); - -protected: - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *event); + QRectF boundingRect() const; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); -private slots: - void updateValue(qreal value); + bool fill() const; + void setFill(bool fill); +//! [0] +//! [1] private: - QBrush brush; QPixmap pix; - QTimeLine timeLine; - qreal lastVal; - qreal opa; - - QGraphicsProxyWidget *proxyWidget; + bool fillRect; + QRectF bounds; + QLinearGradient gradient; }; +//! [1] + +#endif // ROUNDRECTITEM_H diff --git a/examples/graphicsview/padnavigator/splashitem.cpp b/examples/graphicsview/padnavigator/splashitem.cpp index b5b03d4..cd7074a 100644 --- a/examples/graphicsview/padnavigator/splashitem.cpp +++ b/examples/graphicsview/padnavigator/splashitem.cpp @@ -43,31 +43,36 @@ #include <QtGui/QtGui> +//! [0] SplashItem::SplashItem(QGraphicsItem *parent) - : QGraphicsWidget(parent) + : QGraphicsObject(parent) { - opacity = 1.0; - - - timeLine = new QTimeLine(350); - timeLine->setCurveShape(QTimeLine::EaseInCurve); - connect(timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(setValue(qreal))); - text = tr("Welcome to the Pad Navigator Example. You can use the" " keyboard arrows to navigate the icons, and press enter" - " to activate an item. Please press any key to continue."); - resize(400, 175); + " to activate an item. Press any key to begin."); + setCacheMode(DeviceCoordinateCache); +} +//! [0] + +//! [1] +QRectF SplashItem::boundingRect() const +{ + return QRectF(0, 0, 400, 175); } +//! [1] -void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) +//! [2] +void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, + QWidget *widget) { - painter->setOpacity(opacity); + Q_UNUSED(option); + Q_UNUSED(widget); painter->setPen(QPen(Qt::black, 2)); painter->setBrush(QColor(245, 245, 255, 220)); - painter->setClipRect(rect()); + painter->setClipRect(boundingRect()); painter->drawRoundRect(3, -100 + 3, 400 - 6, 250 - 6); - QRectF textRect = rect().adjusted(10, 10, -10, -10); + QRectF textRect = boundingRect().adjusted(10, 10, -10, -10); int flags = Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap; QFont font; @@ -76,17 +81,4 @@ void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWid painter->setFont(font); painter->drawText(textRect, flags, text); } - -void SplashItem::keyPressEvent(QKeyEvent * /* event */) -{ - if (timeLine->state() == QTimeLine::NotRunning) - timeLine->start(); -} - -void SplashItem::setValue(qreal value) -{ - opacity = 1 - value; - setPos(x(), scene()->sceneRect().top() - rect().height() * value); - if (value == 1) - hide(); -} +//! [2] diff --git a/examples/graphicsview/padnavigator/splashitem.h b/examples/graphicsview/padnavigator/splashitem.h index 7a33bee..98c4a1f 100644 --- a/examples/graphicsview/padnavigator/splashitem.h +++ b/examples/graphicsview/padnavigator/splashitem.h @@ -39,25 +39,24 @@ ** ****************************************************************************/ -#include <QtCore/qobject.h> -#include <QtCore/qtimeline.h> -#include <QtGui/qgraphicswidget.h> +#ifndef SPLASHITEM_H +#define SPLASHITEM_H -class SplashItem : public QGraphicsWidget +#include <QGraphicsObject> + +//! [0] +class SplashItem : public QGraphicsObject { Q_OBJECT public: - SplashItem(QGraphicsItem *parent = 0); - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); - -protected: - void keyPressEvent(QKeyEvent *event); + explicit SplashItem(QGraphicsItem *parent = 0); -private Q_SLOTS: - void setValue(qreal value); + QRectF boundingRect() const; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); private: - QTimeLine *timeLine; QString text; - qreal opacity; }; +//! [0] + +#endif // SPLASHITEM_H diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp index 4a6c6ff..0d98eff 100644 --- a/examples/network/bearermonitor/bearermonitor.cpp +++ b/examples/network/bearermonitor/bearermonitor.cpp @@ -255,6 +255,7 @@ void BearerMonitor::onlineStateChanged(bool isOnline) void BearerMonitor::registerNetwork() { QTreeWidgetItem *item = treeWidget->currentItem(); + if (!item) return; QNetworkConfiguration configuration = manager.configurationFromIdentifier(item->data(0, Qt::UserRole).toString()); @@ -276,6 +277,7 @@ void BearerMonitor::registerNetwork() void BearerMonitor::unregisterNetwork() { QTreeWidgetItem *item = treeWidget->currentItem(); + if (!item) return; QNetworkConfiguration configuration = manager.configurationFromIdentifier(item->data(0, Qt::UserRole).toString()); @@ -384,6 +386,7 @@ void BearerMonitor::createSessionFor(QTreeWidgetItem *item) void BearerMonitor::createNewSession() { QTreeWidgetItem *item = treeWidget->currentItem(); + if (!item) return; createSessionFor(item); } diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp index 443f4b2..3a8e5ea 100644 --- a/examples/network/bearermonitor/sessionwidget.cpp +++ b/examples/network/bearermonitor/sessionwidget.cpp @@ -59,7 +59,7 @@ SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *paren connect(session, SIGNAL(stateChanged(QNetworkSession::State)), this, SLOT(updateSession())); connect(session, SIGNAL(error(QNetworkSession::SessionError)), - this, SLOT(updateSession())); + this, SLOT(updateSessionError(QNetworkSession::SessionError))); updateSession(); @@ -105,7 +105,6 @@ void SessionWidget::deleteSession() void SessionWidget::updateSession() { updateSessionState(session->state()); - updateSessionError(session->error()); if (session->state() == QNetworkSession::Connected) statsTimer = startTimer(1000); @@ -128,12 +127,14 @@ void SessionWidget::updateSession() void SessionWidget::openSession() { + clearError(); session->open(); updateSession(); } void SessionWidget::openSyncSession() { + clearError(); session->open(); session->waitForOpened(); updateSession(); @@ -141,12 +142,14 @@ void SessionWidget::openSyncSession() void SessionWidget::closeSession() { + clearError(); session->close(); updateSession(); } void SessionWidget::stopSession() { + clearError(); session->stop(); updateSession(); } @@ -195,3 +198,8 @@ void SessionWidget::updateSessionError(QNetworkSession::SessionError error) errorString->setText(session->errorString()); } +void SessionWidget::clearError() +{ + lastError->clear(); + errorString->clear(); +} diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h index 5e9d62c..b299b47 100644 --- a/examples/network/bearermonitor/sessionwidget.h +++ b/examples/network/bearermonitor/sessionwidget.h @@ -63,7 +63,7 @@ public: private: void updateSessionState(QNetworkSession::State state); - void updateSessionError(QNetworkSession::SessionError error); + void clearError(); private Q_SLOTS: void openSession(); @@ -71,9 +71,12 @@ private Q_SLOTS: void closeSession(); void stopSession(); void updateSession(); + void updateSessionError(QNetworkSession::SessionError error); #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) void deleteSession(); #endif + + private: QNetworkSession *session; int statsTimer; diff --git a/examples/network/bearermonitor/sessionwidget.ui b/examples/network/bearermonitor/sessionwidget.ui index 45135f5..56a2d0e 100644 --- a/examples/network/bearermonitor/sessionwidget.ui +++ b/examples/network/bearermonitor/sessionwidget.ui @@ -195,7 +195,7 @@ <item> <widget class="QLabel" name="errorStringLabel"> <property name="text"> - <string>Error String</string> + <string>Error String:</string> </property> </widget> </item> |